Sax parsing problems. Saxfactory loading different parsers

  • Thread starter christian.bongiorno
  • Start date
C

christian.bongiorno

Ok, my situation is this. I am using the JOX XML bean loading class to
load my java objects from XML. All works well on my development
environment. I am deploying a webservices through tomcat 4.1 in my dev
env. When I deploy the code to the test environment (running a
seriously old JBoss) I find that I get a parse exception.

A remote debug shows me that the only difference is that my dev env.
loads the org.apache.crimson.jaxp.SAXParserImpl and the one that
loads in the JBoss test env is

org.apache.xerces.jaxp.SAXParserImpl

the crimson parser works happy and it validates in my IDE just fine.
So, the question is:
How can I get the factory to load another parser? I would like to find
out why my XML is failing to parse with xerces but not with crimson.
The documents say you can cause it to do a switcher-roo but they don't
mention how.

Ideas?

Christian
http://christian.bongiorno.org/resume.pdf
 
C

christian.bongiorno

Ok, nevermind, I found it. It have to find out which jar has the xerces
parser now, but I found it. For anyone interested:

# Use the javax.xml.parsers.SAXParserFactory system property.
# Use the properties file "lib/jaxp.properties" in the JRE directory.
This configuration file is in standard java.util.Properties format and
contains the fully qualified name of the implementation class with the
key being the system property defined above.
# Use the Services API (as detailed in the JAR specification), if
available, to determine the classname. The Services API will look for a
classname in the file
META-INF/services/javax.xml.parsers.SAXParserFactory in jars available
to the runtime.
# Platform default SAXParserFactory instance.
 
C

christian.bongiorno

Ok, then again, maybe I don't have this down. I am getting
instantiation errors. I decided to override the system property since
it was the easiest. The xerces jar is in my classpath. Should the fully
qualified name NOT be org.apache.xerces.jaxp.SAXParserImpl
 
C

christian.bongiorno

-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl

Ok, I am just not paying attention. Oops.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,690
Members
48,796
Latest member
Greg L.

Latest Threads

Top