3 Replies Latest reply on Sep 12, 2005 10:04 AM by eelgueta

    ClassCastException

    eelgueta

      Hi All,

      I have an EJB 3.0 project that uses Xerces and Axis. I put those jars in /server/all/lib and deploy my app to /server/all/deploy.

      But I keep getting ClassCastExceptions.

      The relevant code is this:

      SOAPMessage reply = con.call(soapMsg, endPoint); <-- Error

      The exception I get is "java.lang.ClassCastException: org.apache.axis.Message"

      How can I make sure JBoss is loading the classes I use in my app? An entry in a descriptor, maybe?

      Thank you in advance.

      Ed.

        • 1. Re: ClassCastException

          Remove xerces jar file from /server/all/deploy folder. Xerces already exists under <JBOSS_HOME>/lib/endorsed folder. as xercesImpl.jar and loaded by Server Loader. Trying to load two jars with the same classes will cause class cast exceptions.

          Remove the xerces jar from /server/all/deploy folder and try running your application.

          Regards.

          Lokesh.

          • 2. Re: ClassCastException

            please change /server/all/deploy in my previous post to /server/all/lib.

            Regards.

            Lokesh.

            • 3. Re: ClassCastException
              eelgueta

              Lokesh,

              Thank you. I tried that and it worked.

              Ed.