Bech on Enterprise Java
Thursday, February 23, 2006
  Problems with Jakarta Axis 1.3 in Oracle 10g (10.1.0.2)
Since I found the solution to this problem on a japanese site (jajakarta), and no trace of it elsewhere I better blog it. I can now only hope that google and all other search engines will index this page, and display it when someone enters the keywords "oracle.xml.parser.v2.XMLDOMException Axis"

When you atempt to deploy a web service on the Oracle 10g platorm (10.1.0.2), using Axis 1.3 straight out of the box, you run into problems with the Oracle XML parser.

I'm not sure exactly what causes this, but I've tracked it down to the class org.apache.axis.utils.XMLUtils It seems this class is not able to initialize fully with the Oracle provided XML libraries.

The result of this problem, is that if anyone try to auto generate a WSDL file by appending ?wsdl to a service

example : http://localhost/services/sampleservice?wsdl )

Axis will provide the following output

Fault - ; nested exception is: oracle.xml.parser.v2.XMLDOMException: Implementation does not support the object requested.

The soultion to this problem is to specify command line arguments to the java VM running the server during startup like this ;


-Djavax.xml.parsers.SAXParserFactory=
org.apache.crimson.jaxp.SAXParserFactoryImpl
-Djavax.xml.parsers.DocumentBuilderFactory=
org.apache.crimson.jax.DocumentBuilderFactoryImpl


As you can see, we here decide to use the crimson parser instead of the one provided in the Oracle XML library. We could also have included Xerces in our application and sepcified the parser provided there ofcourse.
 
Comments:
A similar hint is provided in the Oracle Magazine article on JDOM published September/October 2002.
 
Grab XMLUtils.java from axis source, set the System properties ("javax.xml.parsers.DocumentBuilderFactory" and "javax.xml.parsers.SAXParserFactory") accordingly, compile it and be happy...
 
I added
-Djavax.xml.parsers.SAXParserFactory=
org.apache.crimson.jaxp.SAXParserFactoryImpl
-Djavax.xml.parsers.DocumentBuilderFactory=
org.apache.crimson.jax.DocumentBuilderFactoryImpl

(note the jaxp in the second argument, where you have jax) to the instance server properties using oracle enterprise manager and everything started working great. Thanks!
 
Oops; should be: I added
-Djavax.xml.parsers.SAXParserFactory=
org.apache.crimson.jaxp.SAXParserFactoryImpl
-Djavax.xml.parsers.DocumentBuilderFactory=
org.apache.crimson.jaxp.DocumentBuilderFactoryImpl

(note the jaxp in the second argument, where you have jax) to the instance server properties using oracle enterprise manager and everything started working great. Thanks!

12:29 PM
 
Post a Comment



<< Home
I hereby promise to blog my thoguhts and views on Enterprise java, design patterns, frameworks and all other things that make life as a software developer interesting.

Name:
Location: Oslo, Oslo, Norway

www.glennbech.com

ARCHIVES
May 2005 / June 2005 / July 2005 / January 2006 / February 2006 / June 2006 / July 2006 / August 2006 / October 2006 / November 2006 / March 2007 /


Powered by Blogger