2 Replies Latest reply on Feb 7, 2005 10:29 PM by Michael Gillam

    How to Replace crimson with xerces parser?

    Michael Gillam Newbie

      I'm attempting to do XML schema validation that requires a JAXP 1.2 compliant parser. JBoss and JDK 1.4.x default to using the crimson DocumentBuilderFactoryImpl and SaxParserFactoryImpl.

      I've been trying every possible way of overriding crimson with xerces, but nothing works.

      I put xerces in the classpath, set the system properties...

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

      ...
      created a jaxp.properties file in the jre/lib directory.

      Nothing works!

      Any ideas?

      Thank you

        • 1. Re: How to Replace crimson with xerces parser?
          Anil Saldanha Master

          Dependent on ur JBoss version, the jars should be under lib or lib/endorsed of your JBoss.

          The system property java.endorsed.dirs should point to it.

          • 2. Re: How to Replace crimson with xerces parser?
            Michael Gillam Newbie

            I'm running jboss-3.0.4_tomcat-4.1.12 on Windows XP Pro.

            I created a ...lib/endorsed dir and copied xercesImpl.jar, xml-apis.jar, xmlParsersAPIs.jar to it.

            I set the following system properties:
            -Djava.endorsed.dirs=C:/jboss-3.0.4_tomcat-4.1.12/lib/endorsed
            -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
            -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl

            In my code ...

            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

            When I look at factory in the debugger, it is always the crimson implementation.

            I've been stuck on this for 2 days and I'm going crazy!!!

            I'll appreciate any help.