3 Replies Latest reply on Mar 26, 2010 11:50 AM by jadin

    Webservice ClassCastException in JBoss 4.2.3

    jadin

      Hi,

        I am currently trying to develop an application that allows access to a webservice from inside a web application to do a simple thing like ping the webservice to see if it is available.  However, the problem I am having with JBoss is I am currently receiving the following error:

       

       

      java.lang.ClassCastException: org.apache.cxf.jaxws.ServiceImpl at javax.xml.ws.Service.<init>(Service.java:81)

      at org.myservice.ws.MyWebService.<init>(MyWebService.java:52)

      at org.myapp.mybean.getMyWebService(MyBean.java:103)

       

      I have a stand alone client and I am able to test the webservice from the client just fine, without errors.

       

      When I try to test the webservice from my web application it throws the above error.

       

      This is the call where it dies. (on new instantiation)

       

       

       

      MyWebService service =

      new MyWebService();

       

      I have been able to determine that perhaps jboss's jar library is overwritting my application's jar library, but I have not been able to determine which jar is being over written.  Any help would be appreciated.

        • 1. Re: Webservice ClassCastException in JBoss 4.2.3
          jadin

          <dependencies>
            <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>4.6</version>
             <scope>test</scope>
            </dependency>
            <dependency>
             <groupId>org.mortbay.jetty</groupId>
             <artifactId>jetty</artifactId>
             <version>6.1.9</version>
             <scope>test</scope>
            </dependency>
            <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-frontend-jaxws</artifactId>
             <version>2.2.7</version>
            </dependency>
            <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-transports-http</artifactId>
             <version>2.2.7</version>
            </dependency>
            <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-ws-security</artifactId>
             <version>2.2.7</version>
            </dependency>
            <dependency>
             <groupId>org.apache.xmlbeans</groupId>
             <artifactId>xmlbeans</artifactId>
             <version>2.4.0</version>
            </dependency>
            <dependency>
             <groupId>org.codehaus.mojo</groupId>
             <artifactId>xmlbeans-maven-plugin</artifactId>
             <version>2.3.3</version>
            </dependency>
            <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-jdk14</artifactId>
             <version>1.5.10</version>
            </dependency>
            <dependency>
             <groupId>org.hibernate</groupId>
             <artifactId>hibernate-core</artifactId>
             <version>3.3.2.GA</version>
            </dependency>
            <dependency>
             <groupId>org.hibernate</groupId>
             <artifactId>hibernate-c3p0</artifactId>
             <version>3.3.2.GA</version>
            </dependency>
            <dependency>
             <groupId>javassist</groupId>
             <artifactId>javassist</artifactId>
             <version>3.8.0.GA</version>
            </dependency>
            <dependency>
             <groupId>hsqldb</groupId>
             <artifactId>hsqldb</artifactId>
             <version>1.8.0.7</version>
            </dependency>
            <dependency>
             <groupId>javax.faces</groupId>
             <artifactId>jsf-api</artifactId>
             <version>1.2_02</version>
             <scope>provided</scope>
            </dependency>
            <dependency>
             <groupId>javax.faces</groupId>
             <artifactId>jsf-impl</artifactId>
             <version>1.2-b19</version>
             <scope>provided</scope>
            </dependency>
            <dependency>
             <groupId>javax.xml</groupId>
             <artifactId>jaxrpc-api</artifactId>
             <version>1.1</version>
            </dependency>
            <dependency>
             <groupId>org.apache.axis</groupId>
             <artifactId>axis</artifactId>
             <version>1.4</version>
            </dependency>
            <dependency>
             <groupId>org.apache.myfaces.tomahawk</groupId>
             <artifactId>tomahawk</artifactId>
             <version>1.1.8</version>
            </dependency>
            <dependency>
             <groupId>commons-discovery</groupId>
             <artifactId>commons-discovery</artifactId>
             <version>20040218.194635</version>
            </dependency>
            <dependency>
             <groupId>net.sf.locale4j</groupId>
             <artifactId>locale4j</artifactId>
             <version>1.1.3</version>
            </dependency>
            <dependency>
             <groupId>javax.mail</groupId>
             <artifactId>mail</artifactId>
             <version>1.4.1</version>
            </dependency>
            <dependency>
             <groupId>javax.activation</groupId>
             <artifactId>activation</artifactId>
             <version>1.1</version>
            </dependency>
            <dependency>
             <groupId>org.mortbay.jetty</groupId>
             <artifactId>jsp-api-2.1</artifactId>
             <version>6.1.9</version>
             <scope>test</scope>
            </dependency>
            <dependency>
             <groupId>com.sun.el</groupId>
             <artifactId>el-ri</artifactId>
             <version>1.0</version>
            </dependency>
            <dependency>
             <groupId>mysql</groupId>
             <artifactId>mysql-connector-java</artifactId>
             <version>5.1.10</version>
            </dependency>
            <dependency>
             <groupId>org.hibernate</groupId>
             <artifactId>hibernate-ehcache</artifactId>
             <version>3.3.2.GA</version>
            </dependency>
            <dependency>
             <groupId>commons-fileupload</groupId>
             <artifactId>commons-fileupload</artifactId>
             <version>1.0</version>
            </dependency>
            <dependency>
             <groupId>opensymphony</groupId>
             <artifactId>quartz-all</artifactId>
             <version>1.6.3</version>
            </dependency>
            <dependency>
             <groupId>de.odysseus.juel</groupId>
             <artifactId>juel</artifactId>
             <version>2.1.0</version>
            </dependency>
            <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
             <version>2.4</version>
             <scope>provided</scope>
            </dependency>
            <dependency>
             <groupId>javax.servlet.jsp</groupId>
             <artifactId>jsp-api</artifactId>
             <version>2.0</version>
             <scope>provided</scope>
            </dependency>
            <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>jstl</artifactId>
             <version>1.2</version>
            </dependency>
            <dependency>
             <groupId>taglibs</groupId>
             <artifactId>standard</artifactId>
             <version>1.1.2</version>
            </dependency>
            <dependency>
             <groupId>com.sun.xml</groupId>
             <artifactId>jaxws-tools</artifactId>
             <version>2.0EA3</version>
            </dependency>
            <dependency>
             <groupId>javax.jws</groupId>
             <artifactId>jsr181-api</artifactId>
             <version>1.0-MR1</version>
            </dependency>
            <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>
             <version>1.2.15</version>
             <exclusions>
              <exclusion>
               <groupId>javax.mail</groupId>
               <artifactId>mail</artifactId>
              </exclusion>
              <exclusion>
               <groupId>javax.jms</groupId>
               <artifactId>jms</artifactId>
              </exclusion>
              <exclusion>
               <groupId>com.sun.jdmk</groupId>
               <artifactId>jmxtools</artifactId>
              </exclusion>
              <exclusion>
               <groupId>com.sun.jmx</groupId>
               <artifactId>jmxri</artifactId>
              </exclusion>
             </exclusions>
            </dependency>
          </dependencies>

           

          Here is a list of my dependencies.  I have currently pulled every jar file out of jboss, and I still get the same result every time (except for those jar files that cause jboss not to run anymore, which I quickly place back into the dirs it comes from.

          • 2. Re: Webservice ClassCastException in JBoss 4.2.3
            jadin

            Ive found that this works on JBoss 5 and 5.1.  This is specific to 4.2.3.

            • 3. Re: Webservice ClassCastException in JBoss 4.2.3
              jadin

              Turns out cxf hardcoded the file path url into workspace wsdl, so a cxf problem not jboss.  It should have pointed to the wsdl accessible from the jboss server.