jersey_No WebApplication provider is present
来源:互联网 发布:检测硬件的软件 编辑:程序博客网 时间:2024/06/08 05:40
用eclipse体验jersey框架~
首先,新建一个maven项目
选择Jersey原型(archeTypes)
如果maven插件中没有Jersey原型,可以远程加载,方法如下:
目录(catalogs)文件地址:http://repo1.maven.org/maven2/archetype-catalog.xml
生成之后的代码结构如图所示:
不用手动添加代码就生成包含启动小程序(main.java)的项目,run as java application 后,报异常:
运行项目
<span style="font-family:Microsoft YaHei;font-size:14px;">四月 18, 2016 1:37:15 下午 com.sun.jersey.api.core.PackagesResourceConfig init信息: Scanning for root resource and provider classes in the packages: com.test1.JerseyTest1四月 18, 2016 1:37:15 下午 com.sun.jersey.api.core.ScanningResourceConfig logClasses信息: Root resource classes found: class com.test1.JerseyTest1.MyResource四月 18, 2016 1:37:15 下午 com.sun.jersey.api.core.ScanningResourceConfig init信息: No provider classes found.Starting grizzly2...Exception in thread "main" com.sun.jersey.api.container.ContainerException: No WebApplication provider is presentat com.sun.jersey.spi.container.WebApplicationFactory.createWebApplication(WebApplicationFactory.java:69)at com.sun.jersey.api.container.ContainerFactory.createContainer(ContainerFactory.java:160)at com.sun.jersey.api.container.ContainerFactory.createContainer(ContainerFactory.java:134)at com.sun.jersey.api.container.grizzly2.GrizzlyServerFactory.createHttpServer(GrizzlyServerFactory.java:243)at com.test1.JerseyTest1.Main.startServer(Main.java:38)at com.test1.JerseyTest1.Main.main(Main.java:43)</span>
pom.xml,其中jersey-grizzly2和jersey-client是上拨云剑查的版本号,求解
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.test1</groupId> <artifactId>JerseyTest1</artifactId> <packaging>jar</packaging> <version>0.0.1-SNAPSHOT</version> <name>JerseyTest1</name> <dependencies> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-grizzly2</artifactId> <version>1.18.1</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.2</version> <scope>test</scope> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-client</artifactId> <version>1.18</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <inherited>true</inherited> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.1</version> <executions> <execution> <goals> <goal>java</goal> </goals> </execution> </executions> <configuration> <mainClass>com.test1.JerseyTest1.Main</mainClass> </configuration> </plugin> </plugins> </build> <properties> <jersey-version>1.20-SNAPSHOT</jersey-version> </properties></project>
阅读全文
2 0
- jersey_No WebApplication provider is present
- jersey_No WebApplication provider is present
- 解决Jersey No WebApplication provider is present问题
- Bean Validation provider is not present, therefore bean validation is disabled
- Present is Gift
- Why is Present so slow?
- The gift is the present
- Why today is called present
- jQuery check if horizontal scroll is present
- Required String parameter is not present
- Required CommonsMultipartFile parameter 'file' is not present
- required string parameter XXX is not present
- Required CommonsMultipartFile parameter 'pic' is not present
- Required MultipartFile parameter 'file' is not present
- Required String parameter '×××' is not present
- Required MultipartFile parameter 'uploadFiles' is not present
- Required int[] parameter 'ids' is not present
- Required String parameter is not present
- SVN checkout出来的项目如何配置才不会出错!
- LeetCode 234 Palindrome Linked List (链表 快慢指针)
- 1099端口占用问题解决方案
- Maven设置将src/main/java下的xml编译到classpath
- opencv / python+opencv学习资料链接汇总
- jersey_No WebApplication provider is present
- Tensorflow中tf.get_variable和tf.variable_scope的使用
- Android4.4.2下 RTL8732BU 驱动移植
- ACCC
- [JAVA][Spring]Spring中Bean的命名问题(id和name区别)及ref和idref之间的区别
- Unity学习笔记
- js中json对象的定义、取值等
- java本地调用cmd,shell命令,远程调用Linux执行命令方法总结
- Java反射机制详解