2 Replies Latest reply on Sep 12, 2012 5:28 AM by Rodel Talampas

    JBoss EAP 5.1 - CXF 2.3.1 Client Implementation Issue

    Rodel Talampas Newbie

      All,

       

      After solving my JBOSS 5.1 EJB issue, I came up with another show stopper.

       

      We have a webservice module that was generated using CXF 2.3.1 WSDL2JAVA.  The client (another webservice) is throwing a ClassCastException when invoking the WSClient API.

       

      java.lang.ClassCastException: org.jboss.ws.core.jaxws.spi.ProviderImpl cannot be cast to javax.xml.ws.spi.Provider

      at javax.xml.ws.spi.Provider.provider(Provider.java:43)

      at javax.xml.ws.Service.<init>(Service.java:35)

      ...

      ...

      ...

      (See server1.log)

       

      This is deployed in our new JBOSS EAP 5.1 Server. This implementation is working in JBOSS EAP 4.3.

       

      Reading some resolutions online did not help me at all. The closes solution I got is to replace the JAXB API in the JBOSS Lib/endorsed Folder.

       

      Get latest Jaxb API and put it in Jboss/lib/endorsed folder (delete old jaxb api).

       

      New

      jaxb-api.jar

      jaxb-impl.jar

      jaxws-api.jar

      jaxws-rt.jar

       

      After doing so, I got a new Exception:

      javax.xml.ws.WebServiceException: Error creating JAXBContext for W3CEndpointReference

       

      It seems that I have some conflicting JAXB Libraries upon doing so.

       

      Anyone have the same experience and would like to share some information will be much appreciated.

       

      Thanks and regards,

      Rodel

        • 1. Re: JBoss EAP 5.1 - CXF 2.3.1 Client Implementation Issue
          rene Boers Newbie

          Hi Rodel,

           

          We currently also using cxf version 2.3.1 on jboss 5.1 without problems.

           

          We generate code from wsdl with the maven cxf-codegen-plugin version 2.5.0.

           

          <plugin>

                  <groupId>org.apache.cxf</groupId>

                  <artifactId>cxf-codegen-plugin</artifactId>

                  <version>2.5.0</version>

                  <dependencies>

                    <dependency>

                      <groupId>org.jvnet.jaxb2_commons</groupId>

                      <artifactId>jaxb2-basics</artifactId>

                      <version>0.6.3</version>

                    </dependency>

                    <dependency>

                      <groupId>org.apache.cxf</groupId>

                      <artifactId>cxf-rt-bindings-soap</artifactId>

                      <version>2.5.0</version>

                    </dependency>

                  </dependencies>

                  <executions>

                    <execution>

                      <id>generate-sources</id>

                      <phase>generate-sources</phase>

                      <configuration>

                        <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>

                      </configuration>

                      <goals>

                        <goal>wsdl2java</goal>

                      </goals>

                    </execution>

                  </executions>

                </plugin>

           

          We also using following dependencies regarding jaxb.

          <dependency>

                <groupId>javax.xml.bind</groupId>

                <artifactId>jaxb-api</artifactId>

                <scope>provided</scope>

                <version>2.1</version>

              </dependency>

           

              <dependency>

                <groupId>com.sun.xml.bind</groupId>

                <artifactId>jaxb-impl</artifactId>

                <scope>provided</scope>

                <version>2.1.12</version>

              </dependency>

           

           

          Maybe you can try to generate the code this way and see if there are differences in the generated code that can explain why your code is not working.

          1 of 1 people found this helpful
          • 2. Re: JBoss EAP 5.1 - CXF 2.3.1 Client Implementation Issue
            Rodel Talampas Newbie

            Thanks Rene for your quick reply. I have a separate team working on our Maven Implementation but they are stil using Jboss EAP 4.3.  They have not merged my code changes yet regarding JBoss EAP 5.1. If what you mentioned is true, then I may pass them this CXF migration after they have fully completed their Maven Builds.

             

            I may still need others suggestion who are not using Maven. I need to have some quick R&D regarding this.

             

            Thanks,

            Rodel