jersey_No WebApplication provider is present
来源:互联网 发布:java 多线程 线程池 编辑:程序博客网 时间:2024/06/03 17:06
用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>
0 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
- 查看当前SQL执行,包括执行状态
- Node.js 文档翻译稿
- Stopwatch 类
- 两步搞定 Tomcat 下启用 https:// 访问
- java中HashMap详解
- jersey_No WebApplication provider is present
- 奇葩的非理性
- 无向图强连通分量缩点+DFS序 codeforces555E Case of Computer Network
- 得到缓存及清理缓存
- EXCEL宏函数汇总
- adaboost python 实例
- PostgreSQL中删除的数据能否恢复
- SFilter框架理解
- [POJ 3684] Physics Experiment (脑洞+弹性碰撞模型)