8 Replies Latest reply on Mar 8, 2007 1:08 AM by rajesh_cbe1977

    Problems with JDOM + XPath in JBoss 4.0.1

    anders.hedstrom

      Hi,

      I have an J2EE application that uses JDOM 1.0. I'm using the XPath feature of JDOM as well. To be able to use the XPath feature you need jdom.jar plus three other jar files, jaxen-core.jar, jaxen-jdom.jar and saxpath.jar. I have packaged these four jars in my app.ear file and I have added a Class-Path entry in my ejb.jar manifest file.

      Class-Path: jdom.jar jaxen-jdom.jar jaxen-core.jar saxpth.jar


      All this work very well when I run my app in JBoss 4.0.0, but when I try to use JBoss 4.0.1 I get an exception;
      java.lang.NoClassDefFoundError: org/jdom/Text: org/jdom/Text


      A difference between 4.0.0 and 4.0.1 I have noticed is that jaxen.jar have been added to jboss-4.0.1/lib. The only way I have succeded to get my application to work in 4.0.1, is to remove jaxen.jar from jboss-4.0.1/lib. This feels like a bad solution, my guess is that JBoss needs jaxen.jar at some time...

      How am I supposed to handle this in a correct way? Can I force JBoss to use the supplied jaxen jars in the app.ear file in my app context in some way?

      Greatfull for any suggestions

      Cheers

      //Anders =)

        • 1. Re: Problems with JDOM + XPath in JBoss 4.0.1

          I have exactly the same problem..

          I have tried to solve this by isolating my classloader using the jboss-app.xml
          file in my EAR but this kicked up all sorts of errors..

          <jboss-app>
          <loader-repository>
          dot.com:loader=unique-archive-name
          </loader-repository>
          </jboss-app>

          Just curious to know whether you got any further with this? or found another way other than deleting the jaxen.jar file.

          Yours
          Phil

          • 2. Re: Problems with JDOM + XPath in JBoss 4.0.1
            anders.hedstrom

            Hi Phil,

            no is the answer to your question....I haven't got any futher. I still run my app in JBoss 4.0.1, but I have removed jaxen.jar from the lib directory. Everything works fine so far....I haven't experienced any problems since I removed jaxen.jar.

            But I would like to handle this problem in a more correct way, so please let me know if you figure something out.

            Cheers

            //Anders =)

            • 3. Re: Problems with JDOM + XPath in JBoss 4.0.1
              thebadpete

              Hi folks,

              I also use JDOM 1.0 and its XPath features in 4.0.1. I don't encounter any problems. However, the way I package my ear file is something like the following:

              <master.ear>
              <master-web.war>
              <master-ejb.jar>

              In master.ear's jboss-app.xml, I specify master-ejb.jar in the <loader-repository> tab. I use JDOM/XPath in master-ejb.jar(inside local stateless session beans). In the application.xml of the ear file, I specify master-web.war and master-ejb.jar to load. The ClassPath parameter in MANIFEST.MF of the ear file does not specify anything, while in master-web.war I specify master-ejb.jar. The same structure has been deployed in 3.6, 4.0.0 and 4.0.1 and so far I haven't encounter any conflicts. I know it doesn't really help, but just would like to point out that it does work for me...

              Regards,
              Pete

              • 4. Re: Problems with JDOM + XPath in JBoss 4.0.1
                thebadpete

                Ops, formating got lost. I meant to say master.ear includes master-ejb.jar and master-web.war.

                • 5. Re: Problems with JDOM + XPath in JBoss 4.0.1
                  anders.hedstrom

                  I added the jboss-app.xml to my app.ear with the following entry:

                  <loader-repository>your.dot.com:loader=my-ejb.jar</loader-repository>


                  Now it works without me deleteing the jaxan.jar from $JBOSS_HOME/lib directory.

                  Thanks Pete for your input!

                  Cheers

                  //Anders =)

                  • 6. Re: Problems with JDOM + XPath in JBoss 4.0.1
                    anders.hedstrom

                     

                    "anders.hedstrom" wrote:
                    jaxan.jar


                    should be jaxen.jar =)

                    • 7. Re: Problems with JDOM + XPath in JBoss 4.0.1
                      janapoornavel

                      fear you are using the another version of jaxen.jar,you could find the jaxen jar which the jboss uses in jboss/lib directory,replace it with the verion you use,that should solve the problem

                      • 8. Re: Problems with JDOM + XPath in JBoss 4.0.1
                        rajesh_cbe1977

                        I'm using JBoss 3.2.3. It's also giving the same error.

                        NoClassDefFoundError: org/jdom/text.

                        But all other machines are working smoothly with this version. I've copied the same files and changed some codes that relevant to this machine. I've made this same thing in other machines. But they are not displaying this error.