Tag - java

java ws.rs restful    2017-04-28 16:21:43    389

错误信息

  1. Java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder;
  2. at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119)
  3. at com.sun.jersey.spi.Container.servlet.ServletContainer.service(ServletContainer.java:669)
  4. at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
  5. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  6. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  7. at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
  8. at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
  9. at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
  10. at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
  11. at org.apache.shiro.subject.support.DelegatingSubject.execute(Delega
java jetty Docker maven    2017-03-26 23:38:30    26

1. 准备好一个非常简单点的web项目(maven项目)

2. 准备好maven环境,并配置pom文件,关于jetty内容如下:

  1. <!-- jetty dependecies begin -->
  2. <dependency>
  3. <groupId>org.eclipse.jetty</groupId>
  4. <artifactId>jetty-server</artifactId>
  5. <version>9.1.4.v20140401</version>
  6. </dependency>
  7. <dependency>
  8. <groupId>org.eclipse.jetty</groupId>
  9. <artifactId>jetty-webapp</artifactId>
  10. <version>9.1.4.v20140401</version>
  11. </dependency>
  12. <dependency>
  13. <groupId>org.eclipse.jetty</groupId>
  14. <artifactId>jetty-continuation</artifactId>
  15. <version>9.1.4.v20140401</version>
  16. </dependency>
  17. <dependency>
  18. <groupId>org.eclipse.jetty</groupId>
  19. <artifactId>jetty-jsp</artifactId>
  20. <version>9.1.4.v20140401</version>
  21. </dependency>
  22. <!-- jetty dependecies end -->

3. 使用eclipse对maven项目进行build,获取build后的项目目录(或者将项目达成war包)

4. 创建运行配置jetty的Server类

运行war包的类

  1. public class WebAppWarServer {
  2. public static void main(String[] args) throws Exception {
  3. Server server = new Server(8080);
7/7