0 Replies Latest reply on Aug 16, 2012 11:24 AM by djabba74

    wsprovide, Error: Could not load class

    djabba74 Newbie

      Hi

       

      Something is missing in the guidelines of wsprovide at these pages. The example with the Echo.java, wsprovide will throw an "Error: Could not load class"...

      https://community.jboss.org/wiki/JBossWS-JAX-WSTools#BottomUp_Using_wsprovide

      https://community.jboss.org/docs/DOC-13543

       

      That's the suggested Echo.java

      package echo;
       
      @javax.jws.WebService
      public class Echo
      {
         public String echo(String input)
         {
            return input;
         }
      }
      
      

       

      That's the suggested compile and wsprovide command

      [root@rhel6 test_wsprovide]# javac -d . -classpath jboss-jaxws.jar Echo.java
      [root@rhel6 test_wsprovide]# find .
      .
      ./echo
      ./echo/Echo.class
      ./Echo.java
      [root@rhel6 test_wsprovide]# /usr/share/jbossas/bin/wsprovide.sh -w echo.Echo
      Error: Could not load class [echo.Echo]. Did you specify a valid --classpath?
      

       

       

      This one works  (note: no -classpath jboss-jaxws.jar for javac, but a --classpath=. for wsprovide.sh):

      [root@rhel6 test_wsprovide]# javac -d .  Echo.java
      [root@rhel6 test_wsprovide]# /usr/share/jbossas/bin/wsprovide.sh -w --classpath=. echo.Echo
      Could not find log4j.xml configuration, logging to console.
      
      java2ws -s /tmp/test_wsprovide/output -classdir /tmp/test_wsprovide/output -d /tmp/test_wsprovide/output -verbose -wsdl -cp /tmp/test_wsprovide/./: -wrapperbean -createxsdimports echo.Echo
      java2ws - Apache CXF 2.4.6-redhat-1
      
      

       

      IMHO, the documentation needs to be fixed, or wsprovide should have a default classpath of "."

       

      regards

      Leo