I'm seeing the following error in my stacktrace:

java.lang.AbstractMethodError: Receiver class com.sun.jersey.api.uri.UriBuilderImpl 
does not define or inherit an implementation of the resolved method 'abstract 
javax.ws.rs.core.UriBuilder uri(java.lang.String)' of abstract class javax.ws.rs.core.UriBuilder.

The app code was compiled with Jersey 1.19 and Jackson 1.9.2 and for use on Apache Tomcat 7.x. The code was moved over to Apache Tomcat 9.x without recompilation. I am seeing newer versions of Jackson deployed to Tomcat 9.x, which means there are other applications which are dependent on said new version. Jackson 2.1.0. And I also see jakarata.ws.rs-api-2.1.5.

I want to avoid having to upgrade the app code to a Jersey 2.x because that will involve updating the code which could take a bit of time. It is just for this UriBuilder class. Is there some way to make the app continue to work with Jersey 1.19 and appease this error?

I already checked AbstractMethodError using UriBuilder on JAX-RS and Jersey 2.0 equivalent to POJOMappingFeature and the web.xml changes specified didn't help. From what the instructions say, it appears I do have the recompile the app code but only need to update javax.ws.rs to 2.x and can leave jersey 1.19 as is:

<dependency>
    <groupId>javax.ws.rs</groupId>
    <artifactId>javax.ws.rs-api</artifactId>
    <version>2.0-m12</version>
</dependency>

Is that right? If not, what can I do to ensure I can keep using Jersey 1.19 and avoid code changes?

0

There are 0 best solutions below