0

I am trying to deploy jersey 1.19 app on websphere 8.5.5.13 running on Java 8 The jersey jars I am using :

  • jersey-bundle-1.19.1.jar
  • jersey-core-1.19.jar
  • jersey-json-1.19.4.jar
  • jersey-server-1.19.jar

Also I added the following JVM property :

com.ibm.websphere.jaxrs.server.DisableIBMJAXRSEngine = true

Also I make the classloader for my application to be parent_last

the application start fine but when trying to access any rest method I get the following exception :

com.ibm.ws.webcontainer.servlet.ServletWrapper service Uncaught service() exception thrown by servlet Jersey REST Service: java.lang.LinkageError: loading constraint violation when resolving method "org/codehaus/jackson/jaxrs/JacksonJsonProvider.isWriteable(Ljava/lang/Class;Ljava/lang/reflect/Type;[Ljava/lang/annotation/Annotation;Ljavax/ws/rs/core/MediaType;)Z" : loader "com/ibm/ws/classloader/CompoundClassLoader@5d1f2124" of class "com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy" and loader "org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader@6115f138" of class "org/codehaus/jackson/jaxrs/JacksonJsonProvider" have different types for the method signature
    at com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy.isWriteable(JacksonProviderProxy.java:146)
    at com.sun.jersey.core.spi.factory.MessageBodyFactory._getMessageBodyWriter(MessageBodyFactory.java:395)
    at com.sun.jersey.core.spi.factory.MessageBodyFactory._getMessageBodyWriter(MessageBodyFactory.java:382)
    at com.sun.jersey.core.spi.factory.MessageBodyFactory.getMessageBodyWriter(MessageBodyFactory.java:363)
    at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:267)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1510)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
    at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at com.ibm.ws.cache.servlet.ServletWrapper.serviceProxied(ServletWrapper.java:307)
    at com.ibm.ws.cache.servlet.CacheHook.handleFragment(CacheHook.java:562)
    at com.ibm.ws.cache.servlet.CacheHook.handleServlet(CacheHook.java:255)
    at com.ibm.ws.cache.servlet.ServletWrapper.service(ServletWrapper.java:259)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1233)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:782)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:481)
    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1114)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4028)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1016)
    at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:287)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
    at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
    at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
    at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
Mahmoud Saleh
  • 33,303
  • 119
  • 337
  • 498
  • Are you manually adding Jars or are you using Maven? – Paul Samsotha Oct 05 '22 at 14:48
  • Does that version of Jersey have a Jackson dependency? You might need to add that to your app - it looks like it's getting the server's copy of Jackson, and that links to the server's JAX-RS API instead of the app's copy. – Jarid Oct 05 '22 at 15:08
  • Check this - [JAX-RS Jersey 2.10 support in Websphere 8](https://stackoverflow.com/a/24713878/3701228) – Gas Oct 05 '22 at 19:48
  • @Paul Samsotha,Manually adding jars, it's an old project I received – Mahmoud Saleh Oct 06 '22 at 04:44
  • @Jarid, thanks a lot for the comment, it helped me to solve the issue, but I am confused why this behavior happens on production only not in development although it's the same ear file ! – Mahmoud Saleh Oct 06 '22 at 05:32

1 Answers1

0

I was able to solve the issue thanks to @Jarid I had to add Jackson jars to the application lib folder although those jars doesn't exist on development environment and the application is working fine on development environment !

1- jackson-annotations-2.8.0.jar

2- jackson-core-2.8.1.jar

3- jackson-databind-2.8.1.jar

4- jackson-jaxrs-base-2.8.1.jar

5- jackson-jaxrs-json-provider-2.8.1.jar

6- jackson-module-jaxb-annotations-2.8.1.jar

You can download them all from : https://jar-download.com/artifacts/com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/2.8.1/source-code

After adding jackson jars I had to add the following jersey jar : jersey-servlet-1.19.jar

Mahmoud Saleh
  • 33,303
  • 119
  • 337
  • 498