Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: minor fixes in OC4j section

...

This guide covers only 10.1.3.X.X version of OC4J. Not Note that OC4J 10.1.2 is not JSE 1.5 certified server. OC4J 11g 11_g_ is fully JEE 5.0 certified stack and comes with their own JAX-WS implementation.

...

Oracle OC4J comes with highly customized XML stack by Oracle including SAX, StAX, JAXP, JAX-WS, SAAJ, WSDL4J WSDL and few others. All of those frameworks are Oralce proprietary implementations in OC4J distribution. This giver gives Oracle really good interoperability between their products (e.g. Database) and insures assures interoperability with all Oracle portfolio. However it makes rather hard to introduce something which needs different implementation of above APIs.

Tip

Anchor
orajaxws
orajaxws

OC4J 10.1.3 comes with preliminary implementation of JAX-WS (JSR-181) but this implementation is somewhat limited only to top-down scenario, with very limited customization (lack of JAXB 2.0 etc.).

Configuration overview

Few components need to be customized in OC4J towards CFX integration:

...

Swapping Oracle XML parser with Xerces

Basic ide idea behind how to do this is described in details here

Create OC4J shared libary named cxf.foundation and put there:

...

Get rid of OC4J JAX-WS libraries

OC4J has preliminary support for JAX-WS, unfortunately this means that during OC4J boot there are loaded outdated JAX-WS APIs and implementation by Oracle. This occurs even before shared libraries comes into action, on 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:

...

and comment out line which include jws-api.jar entry, like below

Code Block
xml
xml
<!-- <code-source path="${oracle.home}/webservices/lib/jws-api.jar" if="java.specification.version == /1\.[5-6]/"/> -->
  • repackage oc4j.jar (don't forget about MANIFEST.MF - use jar -m META-INF/MANIFEST.MF)

Anchor
wsdl4j
wsdl4j

swapping Oracle wsdl.jar with wsdl4j.jar

Add Additionally Oracle provides it's own implementation of WSDL functinality which conflicts with wsdl4j.jar. To get rid of this add -Xbootclasspath/p:"<path to wsdlj>/wsdl4j-1.6.1.jar" option to JVM parametrs (either in command line running OC4J standalone or in OPMN).

...

  • 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.

...

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

This primarily happens when:

  • xerces is loaded twice - by shared library class loader and application class loader
  • or when there is mismatch between xerces and oracle implementation of SAX API

Please be sure You properly installed and enabled for Your application cxf.foundation shared library as described here. If Yes please be sure that You didn't include xercesImpl.jar in Your war. If You still have problems please see how You can debu JAXP problems - be sure that org.apache.xerces.jaxp.DocumentBuilderFactoryImpl are instantiated from within JAXP and not {{oracle.xml.parser.v2.DocumentBuilder
}}.

...

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

I'm getting java.lang.NoSuchMethodException: oracle.j2ee.ws.wsdl.extensions.soap.SOAPBodyImpl.getElementType()

...