Resolving conflicts between axis2 and OC4J libraries

I am trying to deploy Axis2 web service on OC4J 10.1.3 application server.

I've used axis 1.4 before and just created my own shared library with all files. There was a problem with 1.4 which was fixed from 1.5, so now I use that, but it doesn't include all libraries. This time I deployed axis2.war to OC4J server and I am using axis2 admin page to try and deploy my web service.

If I propagate the web service through axis 2 then I get java.lang.NoSuchMethodError: javax.jws.WebMethod.exclude()Z

, but I cannot find a conflicting library. There are new jax-ws libraries in Axis2, but I think this is a problem in OC4J app server. I have excluded xml.jar (since it has old JAXB 1.0 libs) and that fixes the problem on my local machine, but not in the linux box.

I tried to change the deployment plan first to find local folders and this allows me to deploy the service, but when I try to access it or WSDL I get a class exception and JXDocumentBuilderFactory error (I currently have the exact error.

I was comparing the shared libraries in the Linux box with the ones on my local machine, and I used the same ones on each (I didn't check the versions of each jar). If axis2 is deployed in OC4J and I deploy my service to axis 2, then am I inheriting the axis2 libraries (jax-ws, etc.)?

+2


source to share


1 answer


Try removing the legacy library in conflict by adding it to your orion-application.xml:

<orion-application>
  <imported-shared-libraries>
    <remove-inherited name="PUT_HERE_THE_NAME_OF_THE_LIBRARY"/>
  </imported-shared-libraries>
</orion-application>

      

More details here: Removing and / or Replacing Oracle Shared Library Imported by Default

Edit:
I searched for shared libraries and found they are not there, jws-api.jar is loaded at boot time and cannot be easily removed:

Replace OCX JAX-WS
Libraries OC4J has preliminary support for JAX-WS, unfortunately this means that at OC4J load time it loads the legacy JAX-WS API and Oracle implementation. This happens even before the shared libraries take effect at the very early stage of OC4J loading.
OC4J boot libraries are configured in the boot.xml file in the $ ORACLE_HOME / j2ee / home / oc4j.jar bootstrap jar. To get rid of this:



1-Copy the jar file to $ {oracle.home} / webservices / lib / jaxws
2-Unzip OC4J.jar file
3-Find META-INF / boot.xml
4-Replace the path in this line with your jar:

<code-source 
   path="${oracle.home}/webservices/lib/jws-api.jar" 
   if="java.specification.version == /1\.[5-6]/"
/>  

      

5-Repackage oc4j.jar (don't forget about MANIFEST.MF - use jar -m META-INF / MANIFEST.MF)

Original article: OC4J Configuration for Web Services

+4


source







All Articles