Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tip

Please make sure your classpath doesn't have the servlet-2.5 library, since WebSphere6.1 is servlet-2.4 compliant!

Add your own class loader

If you put your wsdl4j-1.6.1 jar in $WAS_HOME/java/jre/lib/endorsed all your application will depend on your version of wsdl4j. Another solution is to create a new class loader in your server which loads before parent class loader, create a shared library with your version of wsdl4j and add this shared library to your new class loader. This version of wsdl4j will only be available for your specific server and not affect applications running in other servers.

Step by step

  1. In the WAS console navigate to Environment > Shared Libraries
  2. Select the scope you wish your library should be visible in
  3. Click New and set values ex: name=MYAPP_SHARED_LIB, classpath=PATH_TO/wsdl4j-1.6.1.jar and Save
  4. Wiki Markup
    Navigate to *Application servers > \[your server name\]* *> Java and Process Management > Class loader > New*
  5. Select Classes loaded with application class loader first and Save
  6. Select your new class loader and click Shared library references
  7. Add your shared library (MYAPP_SHARED_LIB) Save and restart your server.

Tested in WAS 6.1 only but should work in earlier versions as well.

OC4J

Note

This guide requires heavy customization of OC4J configuration. Bear in mind that some of steps presented below are either undocumented or unsupported. We strongly advice to do those steps on separate container, dedicated exclusively for CXF.

...

  • xercesImpl.jar (from Xerces distribution)
  • xml-apis-1.2.02.jar (from CXF-distribution)
  • xalan-2.7.0.jar (ditto)
  • geronimo-ws-metadata_2.0_spec-1.1.1.jar (ditto)
    Note

    When building Your application DO NOT INCLUDE THOSE COMPONENTS again.

Get rid of OC4J JAX-WS libraries

...

  • unpack oc4j.jar file
  • locate META-INF/boot.xml file and edit it
  • find section
Code Block
xml
xml
        <!-- WS jax-rpc -->
        <code-source path="${oracle.home}/webservices/lib/jaxr-api.jar"/>
        <code-source path="${oracle.home}/webservices/lib/jaxrpc-api.jar"/>
        <code-source path="${oracle.home}/webservices/lib/jaxb-api.jar"/>
        <code-source path="${oracle.home}/webservices/lib/saaj-api.jar"/>
        <code-source path="${oracle.home}/webservices/lib/jws-api.jar" if="java.specification.version == /1\.[5-6]/"/>

...

  • Edit deployment plan
  • Edit Configure class loading in the deployment plan like described here
  • Uncheck oracle.xml library
  • Check cxf.foundation library
  • Uncheck Search Local Classes First
  • do not include xercesImpl, xml-apis, xalan and geronimo-ws-metadata_2.0_spec-1.1.1.jar in war - those will be automatically loaded by by OC4J Shared Libraries class loader.
    Tip

    You can automate above steps by packaging You war into ear archive (even though) if it's only war and providing orion-application.xml proprietary descriptor as described here. You could also provide proprietary orion-web.xml in Your war instrumenting Search Local Classes First attribute described above. This step is described here.

Oracle FAQ

I'm getting java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

...

I cannot get WSDL (getting HTTP 500 accesing my CXF service WSDL with http://myshot/myservice?wsdlImage Removed)

Please be sure that wsdl4j.jar is loaded before wsdl.jar as described here

...

Wiki Markup
Try something simple. Download OC4J standalone and bootstrap it from command line directly: {{java \[options\] \-jar oc4j.jar}}. Enable [SAX debugging| http://java.sun.com/javase/6/docs/api/javax/xml/parsers/SAXParserFactory.html#newInstance()]. Be sure You don't include douplicated jars in Your application like {{xercesImpl, xalan, xml-apis and geronimo-ws-metadata_2.0_spec-1.1.1.jar}}. Review steps above once more. It works ;).

...