0

Previously we are using Jersey 1.17 and org.apache.cxf 2.6.0 version for different components of our project . Now our proj migrated to Jersey 1.19.4 and cxf 3.2.6 . I saw jersey 1.19.4 holding javax.ws.rs:jsr311-api:jar:1.1.1 where as cxf 3.2.6 holding javax.ws.rs:javax.ws.rs-api:jar:2.1 . All components are compiling successfully without any failure . But in Application We are facing this below issue :-

Oct 17, 2018 10:29:08 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [CA Service REST API] in context with path [/caservice] 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:120) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:669) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationF)

        How We resolve this issue ?

After upgrading this is my dependency tree Structure

         +- org.apache.cxf:cxf-core:jar:3.2.6:compile
        [INFO] |  |  +- com.fasterxml.woodstox:woodstox-core:jar:5.1.0:compile
        [INFO] |  |  |  \- org.codehaus.woodstox:stax2-api:jar:4.1:compile
        [INFO] |  |  \- org.apache.ws.xmlschema:xmlschema-core:jar:2.2.3:compile
        [INFO] |  +- org.apache.cxf:cxf-rt-rs-client:jar:3.2.6:compile
        [INFO] |  |  \- org.apache.cxf:cxf-rt-frontend-jaxrs:jar:3.2.6:compile
        [INFO] |  |     +- javax.ws.rs:javax.ws.rs-api:jar:2.1:compile
        [INFO] |  |     \- javax.annotation:javax.annotation-api:jar:1.2:compile
        [INFO] |  +- org.apache.cxf:cxf-rt-transports-http:jar:3.2.6:compile



              +- com.sun.jersey:jersey-core:jar:1.19.4:compile
        [INFO] |  \- javax.ws.rs:jsr311-api:jar:1.1.1:compile
  • Why. are you using both CXF _and_ Jersey? You're going to need to use the same JAX-RS version. Right now your Jersey is using JAX-RS 1.x and your CXF if using JAX-RS 2.x. You need to decide on one version and stick to it. – Paul Samsotha Oct 18 '18 at 04:42
  • Thanks for quick response #Paul . I tested by excluding only JAX-ES 2.0 from my component , but i was facing this exception java.lang.ClassNotFoundException: javax.ws.rs.core.Link$Builder . – Prakash Chandra Palai Oct 18 '18 at 15:51
  • Hey #Paul , After i saw your comments, I completely excludes CXF dependency from my pom file . Now it is working fine . Thanks a lot. – Prakash Chandra Palai Oct 18 '18 at 15:54

0 Answers0