6 Replies Latest reply on Jul 29, 2011 9:01 AM by Alessio Soldano

    JbossWS-CXF 4.0.0 Beta 2 on Jboss AS6

    Emanuel Braga Newbie

      Hi,

       

      I've upgraded JbossWS-CXF to version 1.0.0 Beta2 aiming to resolve an issue related to WS-Policy. The upgrade went well without error messages, but when I'm trying to generate the webservice client an exception is thrown. As IDE, I'm using Netbeans 7.0.

       

      C:\...\nbproject\jaxws-build.xml:24: taskdef class com.sun.tools.ws.ant.WsImport cannot be found

      using the classloader AntClassLoader[C:\jboss-6.0.0.Final\client\wstx.jar;C:\jboss-6.0.0.Final\client\stax-api.jar;C:\jboss-6.0.0.Final\client\jaxws-api.jar]

       

      How can I resolve this issue?

      Thanks in advance.

        • 1. Re: JbossWS-CXF 4.0.0 Beta 2 on Jboss AS6
          Alessio Soldano Master

          Where you using a vanilla JBoss AS 6 Final version before?

          In any case, the com.sun.tools.ws.ant.WsImport class is part of the Sun/Oracle jaxws-tools.jar that should be available in $JBOSS_HOME/client.

          • 2. Re: JbossWS-CXF 4.0.0 Beta 2 on Jboss AS6
            Emanuel Braga Newbie

            The $JBOSS_HOME, if it is that what you are asking, is C:\jboss-6.0.0.Final\. It always works fine, until I've to make a webservice client where it is needed a specific ws-policy that are not implemented by the default Jboss as6 CXF.

             

            I was looking for the upgrade log. At some point, jaxws-tools.jar is deleted from $JBOSS_HOME/client and isn't replaced by any file.

             

               [delete] Deleting C:\jboss-6.0.0.Final\client\jaxws-tools.jar

             

            I've tried to paste there a copy of the old jaxws-tools.jar but another error occurs:

             

            command line: wsimport -d C:\...\build\generated\jax-wsCache\WS_Production -extension -Xnocompile -Xendorsed -keep -s C:\...\build\generated\jax-wsCache\WS_Production -catalog C:\...\catalog.xml -verbose C:\...\src\conf\xml-resources\web-service-references\WS_Production\wsdl\WS_Production.wsdl -wsdllocation file:/C:/.../WS_Production.wsdl

            C:\...\nbproject\jaxws-build.xml:31:

            java.lang.NoClassDefFoundError: com/sun/xml/ws/util/JAXWSUtils

                at com.sun.tools.ws.wscompile.WsimportOptions.parseArguments(WsimportOptions.java:207)

                at com.sun.tools.ws.wscompile.WsimportOptions.parseArguments(WsimportOptions.java:149)

                at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:169)

                at com.sun.tools.ws.ant.WsImport2.execute(WsImport2.java:689)

                at com.sun.istack.tools.ProtectedTask.execute(ProtectedTask.java:55)

                at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

                at sun.reflect.GeneratedMethodAccessor105.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

                at org.apache.tools.ant.Task.perform(Task.java:348)

                at org.apache.tools.ant.Target.execute(Target.java:390)

                at org.apache.tools.ant.Target.performTasks(Target.java:411)

                at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)

                at org.apache.tools.ant.Project.executeTarget(Project.java:1368)

                at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)

                at org.apache.tools.ant.Project.executeTargets(Project.java:1251)

                at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:284)

                at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)

                at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)

            Caused by: java.lang.ClassNotFoundException: com.sun.xml.ws.util.JAXWSUtils

                at com.sun.istack.tools.ParallelWorldClassLoader.findClass(ParallelWorldClassLoader.java:71)

                at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

                at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

                ... 20 more

             

            Any idea?

             

            Thanks again.

            • 3. Re: JbossWS-CXF 4.0.0 Beta 2 on Jboss AS6
              Alessio Soldano Master

              Emanuel Braga wrote:

               

              The $JBOSS_HOME, if it is that what you are asking, is C:\jboss-6.0.0.Final\.

              I was actually wondering if you had a vanilla AS6 (no other updates) before, but I guess so.

               

               

               

              I was looking for the upgrade log. At some point, jaxws-tools.jar is deleted from $JBOSS_HOME/client and isn't replaced by any file.

               

                 [delete] Deleting C:\jboss-6.0.0.Final\client\jaxws-tools.jar

               

              OK, I need to check why jaxws-tools.jar was there in 6.0 final and is removed by the JBWS 4 Beta2 install scripts. Either is was no needed at all, or removing is a mistake - thanks for having spotted this. However...

               

               

              I've tried to paste there a copy of the old jaxws-tools.jar but another error occurs:

               

              command line: wsimport -d C:\...\build\generated\jax-wsCache\WS_Production -extension -Xnocompile -Xendorsed -keep -s C:\...\build\generated\jax-wsCache\WS_Production -catalog C:\...\catalog.xml -verbose C:\...\src\conf\xml-resources\web-service-references\WS_Production\wsdl\WS_Production.wsdl -wsdllocation file:/C:/.../WS_Production.wsdl

              C:\...\nbproject\jaxws-build.xml:31:

              java.lang.NoClassDefFoundError: com/sun/xml/ws/util/JAXWSUtils

                  at com.sun.tools.ws.wscompile.WsimportOptions.parseArguments(WsimportOptions.java:207)

                  at com.sun.tools.ws.wscompile.WsimportOptions.parseArguments(WsimportOptions.java:149)

                  at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:169)

                  at com.sun.tools.ws.ant.WsImport2.execute(WsImport2.java:689)

                  at com.sun.istack.tools.ProtectedTask.execute(ProtectedTask.java:55)

                  at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

                  at sun.reflect.GeneratedMethodAccessor105.invoke(Unknown Source)

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                  at java.lang.reflect.Method.invoke(Method.java:597)

                  at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

                  at org.apache.tools.ant.Task.perform(Task.java:348)

                  at org.apache.tools.ant.Target.execute(Target.java:390)

                  at org.apache.tools.ant.Target.performTasks(Target.java:411)

                  at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)

                  at org.apache.tools.ant.Project.executeTarget(Project.java:1368)

                  at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)

                  at org.apache.tools.ant.Project.executeTargets(Project.java:1251)

                  at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:284)

                  at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)

                  at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)

              Caused by: java.lang.ClassNotFoundException: com.sun.xml.ws.util.JAXWSUtils

                  at com.sun.istack.tools.ParallelWorldClassLoader.findClass(ParallelWorldClassLoader.java:71)

                  at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

                  at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

                  ... 20 more

               

              Any idea?

              Generally speaking you shouldn't be using the Sun/Oracle tooling directly, unless you manually properly configure the classpath for that. JBoss(WS) comes with his own tooling facade, wsconsume and wsprovide, see the scripts in $JBOSS_HOME/bin . That's what you're supposed to use. Btw, when jbossws-native was the default stack, that used to internally leverage the Sun/Oracle tooling, while with JBossWS-CXF the Apache CXF internal tooling is used.

              • 4. Re: JbossWS-CXF 4.0.0 Beta 2 on Jboss AS6
                Emanuel Braga Newbie

                Hi Alessio,

                 

                Yes, it was a vanilla .

                 

                I've just pasted the jaxws-tools.jar as a test. When I've looked into the log and I've realized that the jar was deleted I thought that it wasn't the solution. However, it was the solution that enabled me to go further.

                • 5. Re: JbossWS-CXF 4.0.0 Beta 2 on Jboss AS6
                  Emanuel Braga Newbie

                  Hi Alessio,

                   

                  Any news about the wsimport and jaxws-tools.jar?

                   

                  Thanks.

                  • 6. Re: JbossWS-CXF 4.0.0 Beta 2 on Jboss AS6
                    Alessio Soldano Master

                    Hi Emanuel,

                    as I said above, you should use the jbossws tools if you want to rely on the libs that are already available on the app server. Did you try using wsconsume instead of wsimport?