2 Replies Latest reply on Mar 20, 2005 8:52 AM by eelgueta

    ClassCastExceptio on deployment (Tomcat)

    eelgueta

      Hi All,

      I have a web service client that runs fine as a console application, but when I deploy it to JBoss (4.0.0, with Lomboz plugin) I get the following exception:

      java.lang.ClassCastException:
      at org.apache.axis.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:103)
      at com.mytest.TestWSClient.sendSoapRequest(TestWSClient.java:318)
      at com.mytest.TestWSClient.connect(TestWSClient.java:76)
      at com.mytest.ConManager.createWSInstance(ConManager.java:109)
      at com.mytest.ConManager.parseConfig(ConManager.java:90)
      at com.mytest.ConManager.(ConManager.java:63)
      at com.mytest.ConManager.(ConManager.java:391)
      at com.mytest.TestSessionControl.getConManager(TestSessionControl.java:169)
      at org.apache.jsp.test2_jsp._jspService(test2_jsp.java:77)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
      :
      :

      I tried putting all of the required jars in the lib directory and setting Java2ClassLoadingCompliance to false (UseJBossWebLoader is set to false, too).

      Please let me know if code/config files are needed for a better diagnosis. Any help is very welcomed.

      TIA,

      Ed.

        • 1. Re: ClassCastExceptio on deployment (Tomcat)
          eelgueta

          BTW, I'm not using the class that appears in the call traceback: org.apache.axis...

          I'm using com.sun.xml.messaging.saaj.soap.MessageFactoryImpl, javax.xml.soap.SOAPConnectionFactory and javax.xml.soap.SOAPConnection.

          I tried adding the jars to the WEB-INF/lib dir with no success.

          Thanks.

          • 2. Re: ClassCastExceptio on deployment (Tomcat)
            eelgueta

            The problem was I was using Sun SOAP classes, which apparently JBoss/Tomcat don't like (BTW, I tried putting the jar files in the lib/endorsed directory, and it started to get better, but when I added the Sun's common-logging jar, JBoss web server couldn't start any more. Talk about write once, run anywhere.

            I rewrote the code for Axis and it works, at least in JBoss 4.0.0 under Windows. It doesn't work in jboss-4.0.1sp1 under linux. Subject for another thread.