问题描述:Eclipse调试JAX-RS服务没问题,但是在发布服务端时候抛出异常
java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder; javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119) com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:651) javax.servlet.http.HttpServlet.service(HttpServlet.java:728) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
解放方案:缺少依赖包
添加依赖包:
<dependency> <groupId>org.glassfish.jersey.bundles</groupId> <artifactId>jaxrs-ri</artifactId> <version>2.22.2</version> </dependency>
http://mvnrepository.com/artifact/org.glassfish.jersey.bundles/jaxrs-ri/2.22.2
可以解决该问题