java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String

INFO: Server startup in 6705 ms
Nov 29, 2013 6:17:38 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [JerseyServlet] in context with path [/jersey_project] threw exception [Servlet execution threw an exception] with root cause
java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder;
    at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:649)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

resaon:

Itseemsthatyou'reusingJersey1.x(JAX-RS1.1implementation)withJAX-RS2.0APIs.InyourapplicationeitherswitchtoJersey2(recommended)orreplaceJAX-RS2.0APIjarwithJAX-RS1.1APIjar(it'salreadypartofthejersey-commonsoremoving2.0APIshouldbesufficient).

<dependency>  
   <groupId>javax.servlet</groupId>  
   <artifactId>javax.servlet-api</artifactId>  
   <version>3.1.0</version>
   <scope>provided</scope>  
</dependency>

为javax.servlet添加scopeprovided或者去掉这个依赖

相关推荐