0 Replies Latest reply on Jul 4, 2005 4:16 AM by flottis

    Override xerces parser with older version

    flottis

      Hello, I've been struggling trying to override the bundled xerces parser quite some time now but have not yet been successful ( I've searched the forums and found some threads having similar problems but I could not find a thread with a solution to the problem so I decided to create a new ).

      I have a third party jar that need xerces 1.4.x, we are currently running JBoss 3.2.3 (Java 1.4.2_04) in our production environment and we have simply replaced the bundled xerces parser with a 1.4.x version, this approach does not work on JBoss 4.0.2 (Java 1.4.2_04) so I've been looking at classloading override/scoping/isolation with jboss-app.xml.

      Qutoing a forum post from Scott M Stark (http://jira.jboss.com/jira/browse/JBAS-1283#action_12316709) indicates that it should be possible to override the bundled xerces parser.


      I have tested being able to override the xml parser implementation in 4.0.2RC1 and it works as expected.


      So down to my situation:

      jboss-app.xml currently looks like this:
      <?xml version="1.0" encoding="UTF-8" ?>
      
      <!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN"
       "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
      
      <jboss-app>
       <loader-repository>
       testing.com:loader=Services.ear
       <loader-repository-config>
       java2ParentDelegation=false
       </loader-repository-config>
       </loader-repository>
      </jboss-app>
      


      At first I got ClassCastException but after reading this thread: http://jira.jboss.com/jira/browse/JBAS-1283 I made sure that I hade no files from xml-apis.jar in my Services.ear/xerces.jar file. This led me to my current problem (JBoss console copy&paste):

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.j2ee:jndiName=debitech/DebitechTransactionArchive,service=EJB
      State: FAILED
      Reason: java.lang.LinkageError: loader constraints violated when linking org/w3c/dom/Document class

      ObjectName: jboss.j2ee:jndiName=doreas/DoreasTransaction,service=EJB
      State: FAILED
      Reason: java.lang.LinkageError: loader constraints violated when linking org/w3c/dom/Document class

      ObjectName: jboss.j2ee:jndiName=debitech/DebitechTransaction,service=EJB
      State: FAILED
      Reason: java.lang.LinkageError: loader constraints violated when linking org/w3c/dom/Document class

      The interesting thing here is that all non working beans are all entity beans with local interfaces. I *think* the error occurs when JBoss tries to parse $JBOSS_HOME/server/$SERVER/conf/standardjbosscmp-jdbc.xml. (The ClassCastException described above occured trying to parse that file at least)

      Any ideas regarding this problem are welcome!

      /Andreas, andreas.toom@comitnet.com