I'm trying to deploy Jersey 2.13 web services to Weblogic 12.1.1. This version of weblogic is compliant with JSR-311 JAX-RS 1.1 specification whereas Jersey 2.x provides implementation for JAX-RS 2.0
Oracle has an instruction on how to upgrade the version of Jersey JAX-RS RI :
http://docs.oracle.com/cd/E24329_01/web.1211/e24983/version.htm
However even this doesn't help solving all of the deployment issues.
I'm packaging the application in EAR containing WAR. In order to override weblogic jars I've included added the following weblogic-application.xml file :
<?xml version="1.0" encoding="ISO-8859-1"?>
<weblogic-application xmlns="http://www.bea.com/ns/weblogic/90">
<prefer-application-packages>
<!-- apis -->
<package-name>javax.ws.rs.*</package-name>
<!-- guava -->
<package-name>com.google.common.*</package-name>
<!-- jersey1 providers -->
<package-name>com.sun.jersey.*</package-name>
<!-- media providers -->
<package-name>org.eclipse.persistence.jaxb.rs.*</package-name>
<package-name>org.codehaus.jackson.jaxrs.*</package-name>
<!-- wls -->
<package-name>weblogic.jaxrs.api.client.*</package-name>
<package-name>weblogic.jaxrs.internal.api.client.*</package-name>
<package-name>weblogic.jaxrs.dispatch.*</package-name>
<package-name>weblogic.jaxrs.monitoring.util.*</package-name>
</prefer-application-packages>
</weblogic-application>
This configuration gives me a following error message on deployment :
Caused By: java.lang.NoSuchMethodError: org.glassfish.hk2.api.ServiceLocatorFactory.create(Ljava/lang/String;Lorg/glassfish/hk2/api/ServiceLocator;Lorg/glassfish/hk2/extension/ServiceLocatorGenerator;Lorg/glassfish/hk2/api/ServiceLocatorFactory$CreatePolicy;)Lorg/glassfish/hk2/api/ServiceLocator;
If I try to replace org.glassfish.hk2.* classes by adding it to prefer-application-packages I receive new errors and it's continuing forever...
Has anyone migrated Jersey to version 2.x on weblogic 12.1.1 or below?
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…