5 Replies Latest reply on Mar 4, 2006 6:49 AM by shorero

    java.lang.LinkageError for org/w3c/dom/Node

    shorero

      I have a set of XML-processing MBeans. The beans work properly under JBoss 4.0.2. Under 4.0.3 I get the following:

      2006-03-03 11:19:38,125 INFO [STDOUT] java.lang.LinkageError: loader constraints violated when linking org/w3c/dom/Node class
      2006-03-03 11:19:38,125 INFO [STDOUT] at com.cst.chetx.core.bean.parser.Parser.receiveData(Parser.java:185)

      Environment is WinXP (current patches), Sun Java 1.5.0_06-b05. The deployment file containing the beans is _identical_ for 4.0.2 and 4.0.3 and contains none of the org.w3c classes. I would have thought that the same classloader would be used for all of the XML/DOM classes, but (given this error) this appears to not be the case. Anybody have any suggestions?

      I will check the 4.0.4RC as well and post the results

        • 1. Re: java.lang.LinkageError for org/w3c/dom/Node
          shorero

          Same problem occurs under 4.0.4RC1, at the same place in the code. FYI, the error happens on a document.getDocumentElement() method call.

          • 2. Re: java.lang.LinkageError for org/w3c/dom/Node
            starksm64
            • 3. Re: java.lang.LinkageError for org/w3c/dom/Node
              shorero

              Thanks for the hint, but I've already gone through the stuff on the wiki, and it doesn't seem to apply. org.w3c.dom.Node is not part of the application, after all -- it's a system class that is normally loaded from rt.jar. In the case of JBoss 4.0.3SP1 (and probably 4.0.4 as well), it looks to me like it should be loaded from the endorsed directory, xml-apis.jar. However, I'd also think that anything in the endorsed directory would not be subject to these class-loader issues.

              This particular set of beans gets loaded by a single loader bean that is the only bean that gets mentioned in the jboss-service.xml file. There's only a single deployment here, but maybe the class loader that an executing bean uses is different than the class loader that the SAR loader uses?

              Any other suggestions?

              • 4. Re: java.lang.LinkageError for org/w3c/dom/Node
                starksm64

                 

                "shorero" wrote:
                Thanks for the hint, but I've already gone through the stuff on the wiki, and it doesn't seem to apply. org.w3c.dom.Node is not part of the application...


                I don't believe you. Print out the code source of the Document class and the Document instance class:

                System.out.println(doc.getClass().getProtectionDomain().getCodeSource());
                System.out.println(Document.class.getProtectionDomain().getCodeSource());
                


                If those are not different try enable trace level logging of the class loading layer.
                http://wiki.jboss.org/wiki/Wiki.jsp?page=EnableClassloaderLogging

                • 5. Re: java.lang.LinkageError for org/w3c/dom/Node
                  shorero

                  You are correct and I am wrong -- bad .jar in the deployment. Thanks for the debugging tip, though.