10 Replies Latest reply on Dec 1, 2010 9:42 AM by izgur

    ClassNotFoundException JBossWSProviderFactoryImpl with JBoss

    gquintana

      I get an exception when I run WSProvide:

      $ wsprovide.sh -k -w -c classes -o classes -r jbossws -s jbossws com.mycompany.myapp.ws.MyWebService
      [: 71: /opt/java/jboss-4.2.2.GA/client/jbossws-client.jar: unexpected operator
      JBossWS-SunRI stack deployed
      Exception in thread "main" java.lang.IllegalStateException: Failed to load: org.jboss.ws.tools.jaxws.impl.JBossWSProviderFactoryImpl
       at org.jboss.wsf.spi.util.ServiceLoader.loadDefault(ServiceLoader.java:205)
       at org.jboss.wsf.spi.util.ServiceLoader.loadFromSystemProperty(ServiceLoader.java:138)
       at org.jboss.wsf.spi.util.ServiceLoader.loadService(ServiceLoader.java:68)
       at org.jboss.wsf.spi.tools.WSContractProvider.newInstance(WSContractProvider.java:65)
       at org.jboss.wsf.spi.tools.cmd.WSProvide.generate(WSProvide.java:170)
       at org.jboss.wsf.spi.tools.cmd.WSProvide.main(WSProvide.java:77)
      Caused by: java.lang.ClassNotFoundException: org.jboss.ws.tools.jaxws.impl.JBossWSProviderFactoryImpl
       at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at org.jboss.wsf.spi.util.ServiceLoader.loadDefault(ServiceLoader.java:200)
       ... 5 more
      

      I am using Ubuntu 7.10, Sun Java 1.5 and standard JBoss 4.2.2.

      What's wrong?

        • 1. Re: ClassNotFoundException JBossWSProviderFactoryImpl with J
          peterj

          The missing class is in client/jbossws-client.jar. Looks like you have to set JBossWS-Native to something (set it ti 1) to get that jar file included in the classpath.

          • 2. Re: ClassNotFoundException JBossWSProviderFactoryImpl with J
            peterj

            Actually, looking a little more carefully, it would appear that the shell (bash?) on Ubuntu did not like the if statement in lines 69-71 ("unexpected operator"). Fedora 8 doesn't have a problem with it; I have Kubuntu 7.10 at home, I'll try there.

            • 3. Re: ClassNotFoundException JBossWSProviderFactoryImpl with J
              gquintana

              You are right, at line, I replaced

              if [ -a $LIBDIR/jbossws-client.jar ]; then

              by
              if [ -f $LIBDIR/jbossws-client.jar ]; then

              and now it works.

              Should I fill a bug report or is it a known bug?

              • 4. Re: ClassNotFoundException JBossWSProviderFactoryImpl with J
                gquintana

                I looked at source code generated by WSImport and there is something weird that doesn't compile:

                @XmlRootElement(...)
                @XmlType(...)
                @XmlAccessorType(XmlAccessType.FIELD)
                public class MyOperationResponse {
                 @XmlElement(namespace = "", name = "return")
                 private MyValueObject return;
                 public MyValueObject getReturn() {
                 return this.return;
                 }
                 public void setReturn(MyValueObject return) {
                 this.return = return;
                 }
                }

                The "return" keyword is reserved and can not be used as attribute, argument...

                The input interface was pretty simple:
                @WebService(...)
                public interface MyWebService {
                 @WebMethod
                 MyValueObject myOperation(String myArgument) throws MyException;
                }


                • 5. Re: ClassNotFoundException JBossWSProviderFactoryImpl with J
                  gquintana

                  Moreover, the WSProvide documentation is not sync'ed with JBossWS 2.

                  Ant task package changed, it's org.jboss.wsf.spi.tools.ant.WSProvideTask instead of org.jboss.ws.tools.jaxws.ant.wsprovide:

                  <target name="wsprovide">
                   <taskdef name="wsprovide" classname="org.jboss.wsf.spi.tools.ant.WSProvideTask">
                   <classpath>
                   <path id="jboss.class.path">
                   <fileset dir="${jboss.dir}/client" includes="*.jar" />
                   <fileset dir="${jboss.dir}/lib/endorsed" includes="*.jar" />
                   </path>
                   </classpath>
                   </taskdef>
                   <wsprovide fork="true" keep="true" verbose="true" genwsdl="true" destdir="classes" resourcedestdir="jbossws" sourcedestdir="jbossws" sei="com.mycompany.myproject.MyWebService">
                   <classpath refid="project.class.path" />
                   </wsprovide>
                   </target>
                  


                  • 6. Re: ClassNotFoundException JBossWSProviderFactoryImpl with J
                    asoldano

                    I've just fixed the documentation. Thank you.

                    • 7. Re: ClassNotFoundException JBossWSProviderFactoryImpl with J
                      izgur

                      I have the same error in JBoss 5.1 (esb + riftsaw on Centos 5.2).

                       

                      I don't have any jbossws-client.jar. ?!  How to solve this Exception in thread "main" java.lang.IllegalStateException: Failed to load: org.jboss.ws.tools.jaxws.impl.JBossWSProviderFactoryImpl 

                      • 8. Re: ClassNotFoundException JBossWSProviderFactoryImpl with J
                        asoldano

                        This discussion is something like 3yrs old... which error? what jbossws version are you using? did you try with something more recent?

                        For instance, you might simply not have jbossws-client.jar because starting from jbossws 3, that's been replaced by jbossws-native-client.jar / jbossws-cxf-client.jar / jbossws-metro-client.jar.

                        • 9. Re: ClassNotFoundException JBossWSProviderFactoryImpl with J
                          izgur

                          I quite sure I have the default jboss as 5.1 configuration, which uses 3.2.1.GA.

                           

                          I solved the problem Failed to load: org.jboss.ws.tools.jaxws.impl.JBossWSProviderFactoryImpl and the next problem with copying jbossws-client.jar and jbossws-spi.jar to /libs/endorsed. Then I got a new error, which I solved by adding java-getopt-1.0.9.jar.

                           

                          Now I get a new error:

                          D:\KKISSWORK\jboss-5.1.0.GA\bin>wsprovide --keep --wsdl --classpath=D:\KKISSWORK\WorkSpace\SimpleServiceImpl\build\classes --output=D:\KKISSWORK\WorkSpace\
                          SimpleServiceImpl\build\classes --resource=D:\KKISSWORK\WorkSpace\SimpleServiceImpl\build\classes --source=D:\KKISSWORK\WorkSpace\SimpleServiceImpl\src si.
                          simpleservice.SimpleServiceImpl --show-traces
                          Output directory: D:\KKISSWORK\WorkSpace\SimpleServiceImpl\build\classes
                          Source directory: D:\KKISSWORK\WorkSpace\SimpleServiceImpl\src
                          Error: Could not generate. (use --show-traces to see full traces)
                          java.lang.NoClassDefFoundError: org/jboss/logging/Logger
                                  at org.jboss.ws.metadata.umdm.UnifiedMetaData.<clinit>(UnifiedMetaData.java:54)
                                  at org.jboss.ws.tools.jaxws.impl.JBossWSProviderImpl.provide(JBossWSProviderImpl.java:85)
                                  at org.jboss.ws.tools.jaxws.impl.JBossWSProviderImpl.provide(JBossWSProviderImpl.java:124)
                                  at org.jboss.wsf.spi.tools.cmd.WSProvide.generate(WSProvide.java:183)
                                  at org.jboss.wsf.spi.tools.cmd.WSProvide.main(WSProvide.java:76)

                           

                           

                          What am I doing wrong ??? I don't believe the WS will expose when I add the 15th jar...

                          Can somebody give me an example how he managed to expose a WS on JBoss 5.1 ?

                           

                          I can't believe it. I exposed a web service on GlassFish/NetBeans in 2minutes, and I was new to web services. On JBoss 2 days past and still nothing...

                          • 10. Re: ClassNotFoundException JBossWSProviderFactoryImpl with J
                            izgur

                            Looks like I'm staying at this point...

                             

                            I tried a different approach, but no matter what way I try to do it.

                            I tried the http://docs.jboss.org/jbossas/6/WebServices_Guide/en-US/html/chap_JBossWS-UserGuide.html, but my wsprovide isn't working...