3 Replies Latest reply on Apr 22, 2005 1:19 AM by anil.saldhana

    JBoss+JDK1.4+Xerces

    jova73

      Hi,
      I'm running JBoss 3.0.3 with JDK 1.4 which comes with Crimson as XML parser but I want to configure JBoss to use Xerces so:
      - I modified the run.bat script to set the relevant JAXP properties
      set JAXP=-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
      set JAXP=%JAXP% -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
      set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name=%PROGNAME% %JAXP%
      ...

      - then I put xerces.jar in JBOSS_HOME\lib

      - then I've started JBoss but I get the following error

      18:50:05,198 INFO [MainDeployer] Starting deployment of package: file:/C:/Java/
      jboss-3.0.3_tomcat-4.0.5/server/default/conf/jboss-service.xml
      18:50:05,258 ERROR [Server] start failed
      javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.Doc
      umentBuilderFactoryImpl not found
      at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderF
      actory.java:99)
      at org.jboss.deployment.SARDeployer.parseDocument(SARDeployer.java:619)
      at org.jboss.deployment.SARDeployer.init(SARDeployer.java:150)
      at org.jboss.deployment.MainDeployer.init(MainDeployer.java:668)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:604)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:580)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:564)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:324)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:221)
      at org.jboss.Main.boot(Main.java:148)
      at org.jboss.Main$1.run(Main.java:381)
      at java.lang.Thread.run(Thread.java:536)
      javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.Doc
      umentBuilderFactoryImpl not found

      Then I modified the classpath adding xerces.jar and now it's OK.
      Can somebody tell me the reason?
      Why the problem does not arise if I don't set JAXP properties? I think that JBoss has to find the right parser via JAXP even if I don't set the properties, or am i wrong?


      Thank you very much in advance,
      Andrea

        • 1. Re: JBoss+JDK1.4+Xerces
          mgillam

          I attempted the same solution and it doesn't work for me.

          No matter what I do to override the default implementation for the DocumentBuilderFactory, it uses crimson instead of xerces.

          I also tried defining a jaxp.properties in the jre/lib directory and it doesn't work.

          Any ideas?

          • 2. Re: JBoss+JDK1.4+Xerces
            prathima

            Does anyone know the solution for this. I am stuck on this for 3 days now.
            Thanks
            prats

            • 3. Re: JBoss+JDK1.4+Xerces
              anil.saldhana

              u shud be using the xerces jars that are located in the jboss_instance/lib/endorsed dirs

              pass a system property to the JDK as follows

              java -Djava.endorsed.dirs=<location of the lib/endorsed dir>
              



              This will use the Xerces parser. More info can be had by looking at how JBoss does this in the run.bat/run.sh scripts.