views:

530

answers:

1

I'm trying to deploy an Axis2 web service to an OC4J 10.1.3 app server.

I was using axis 1.4 before and had just created my own shared library with all of the files. There was an issue with 1.4 that was patched with 1.5 so now I'm using that but it does not include all of the libraries. This time I deployed the axis2.war to the OC4J server and I'm using the axis2 admin page to attempt to deploy my web service.

If I deploy a web service through axis2 then I'll get a java.lang.NoSuchMethodError: javax.jws.WebMethod.exclude()Z but I cannot find the conflicting library. Axis2 has the new jax-ws libraries in it but I think it's an issue on the OC4J app server. I excluded xml.jar (since it has old JAXB 1.0 libs) and this resolves the issue on my local machine but not on the linux box.

I tried editing the deployment plan to search local folders first and this allows me to deploy the service, but when I try to access it, or the WSDL, then I get an error regarding a class cast exception and JXDocumentBuilderFactory (I don't have the exact error at this moment).

I compared the shared libraries on the linux box with the ones on my local machine and I used the same ones on each (I didn't verify the versions of each jar, though). If axis2 is deployed to OC4J and I deploy my service to axis2 then wouldn't I inherit the axis2 libraries (jax-ws, etc)?

+2  A: 

Try removing the inherited library in conflict by adding this 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 here: Removing and/or Replacing an Oracle Shared Library Imported by Default

Edit:
I searched the shared libraries and found that is not there, jws-api.jar is loaded at boot time and can't be removed easily:

Replace the OC4J JAX-WS Libraries
OC4J has preliminary support for JAX-WS, unfortunately this means that during OC4J boot it loads outdated JAX-WS APIs and implementation by Oracle. This occurs even before shared libraries comes into action, at a very early stage of OC4J boot.
Boot-time OC4J libraries are configured in boot.xml file in $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-Unpack the OC4J.jar file
3-Locate META-INF/boot.xml
4-Replace 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

rodrigoap
Unfortunately, there are several other services already running that could depend on the old libraries, so I have been trying to avoid changing anything on the server. Also, I only have access through the Oracle Enterprise Manager and don't have access to the actual machine itself. I'm slowly piecing things together, but it's been a real pain.
ravun