Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-3391

wsprovide script fails with NoClassDefFoundError, 2x missing dependencies

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Minor
    • None
    • jbossws-native-4.0.0.CR1, jbossws-cxf-4.0.0.CR1
    • jbossws-cxf, jbossws-native
    • None
    • Hide

      download the distribution and unpack. execute this to check for the existence of the expected jar file. change the full paths.

      $ pwd
      /home/whitingjr/java/jboss/jbossws-cxf-bin-dist
      $ ls deploy/lib/log4j.jar
      ls: cannot access deploy/lib/log4j.*: No such file or directory
      $ cp /home/whitingjr/jboss-home/client/log4j.jar ./deploy/lib/
      $ ./deploy/bin/wsprovide.sh
      Exception in thread "main" java.lang.NoClassDefFoundError: gnu/getopt/LongOpt
      at org.jboss.ws.tools.cmd.WSProvide.parseArguments(WSProvide.java:89)
      at org.jboss.ws.tools.cmd.WSProvide.main(WSProvide.java:82)
      Caused by: java.lang.ClassNotFoundException: gnu.getopt.LongOpt
      at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
      ... 2 more
      $ cp /home/whitingjr/jboss-home/client/getopt.jar deploy/lib/
      $ ./deploy/bin/wsprovide.sh

      Error: endpoint implementation was not specified!
      WSProvideTask generates portable JAX-WS artifacts for an endpoint implementation.

      usage: WSProvide [options] <endpoint class name>

      options:
      -h, --help Show this help message
      -k, --keep Keep/Generate Java source
      -w, --wsdl Enable WSDL file generation
      -c, --classpath=<path> The classpath that contains the endpoint
      -o, --output=<directory> The directory to put generated artifacts
      -r, --resource=<directory> The directory to put resource artifacts
      -s, --source=<directory> The directory to put Java source
      -e, --extension Enable SOAP 1.2 binding extension
      -q, --quiet Be somewhat more quiet
      -t, --show-traces Show full exception stack traces
      -l, --load-provider Load the provider and exit (debug utility)

      Show
      download the distribution and unpack. execute this to check for the existence of the expected jar file. change the full paths. $ pwd /home/whitingjr/java/jboss/jbossws-cxf-bin-dist $ ls deploy/lib/log4j.jar ls: cannot access deploy/lib/log4j.*: No such file or directory $ cp /home/whitingjr/jboss-home/client/log4j.jar ./deploy/lib/ $ ./deploy/bin/wsprovide.sh Exception in thread "main" java.lang.NoClassDefFoundError: gnu/getopt/LongOpt at org.jboss.ws.tools.cmd.WSProvide.parseArguments(WSProvide.java:89) at org.jboss.ws.tools.cmd.WSProvide.main(WSProvide.java:82) Caused by: java.lang.ClassNotFoundException: gnu.getopt.LongOpt at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) ... 2 more $ cp /home/whitingjr/jboss-home/client/getopt.jar deploy/lib/ $ ./deploy/bin/wsprovide.sh Error: endpoint implementation was not specified! WSProvideTask generates portable JAX-WS artifacts for an endpoint implementation. usage: WSProvide [options] <endpoint class name> options: -h, --help Show this help message -k, --keep Keep/Generate Java source -w, --wsdl Enable WSDL file generation -c, --classpath=<path> The classpath that contains the endpoint -o, --output=<directory> The directory to put generated artifacts -r, --resource=<directory> The directory to put resource artifacts -s, --source=<directory> The directory to put Java source -e, --extension Enable SOAP 1.2 binding extension -q, --quiet Be somewhat more quiet -t, --show-traces Show full exception stack traces -l, --load-provider Load the provider and exit (debug utility)
    • Interactive Demo/Tutorial
    • Workaround Exists
    • Hide

      copying the missing 2 dependencies into the deploy/lib directory will get the wsprovide script working.

      log4j.jar
      getopt.jar

      Show
      copying the missing 2 dependencies into the deploy/lib directory will get the wsprovide script working. log4j.jar getopt.jar
    • Low

    Description

      The CR1 distribution is missing the log4j and getopt.jar libraries. When executing the wsprovide bash script the java command fails to execute because the files do not exist on the file system. Both are defined in the classpath.
      I get this error

      Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Priority
      Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Priority
      at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
      Could not find the main class: org.jboss.ws.tools.cmd.WSProvide. Program will exit.

      $ pwd
      /home/whitingjr/java/jboss/jbossws-cxf-bin-dist
      $ ls deploy/lib/log4j.jar
      ls: cannot access deploy/lib/log4j.*: No such file or directory
      $ cp /home/whitingjr/jboss-home/client/log4j.jar ./deploy/lib/
      $ ./deploy/bin/wsprovide.sh
      Exception in thread "main" java.lang.NoClassDefFoundError: gnu/getopt/LongOpt
      at org.jboss.ws.tools.cmd.WSProvide.parseArguments(WSProvide.java:89)
      at org.jboss.ws.tools.cmd.WSProvide.main(WSProvide.java:82)
      Caused by: java.lang.ClassNotFoundException: gnu.getopt.LongOpt
      at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
      ... 2 more
      $ cp /home/whitingjr/jboss-home/client/getopt.jar deploy/lib/
      $ ./deploy/bin/wsprovide.sh

      Error: endpoint implementation was not specified!
      WSProvideTask generates portable JAX-WS artifacts for an endpoint implementation.

      usage: WSProvide [options] <endpoint class name>

      options:
      -h, --help Show this help message
      -k, --keep Keep/Generate Java source
      -w, --wsdl Enable WSDL file generation
      -c, --classpath=<path> The classpath that contains the endpoint
      -o, --output=<directory> The directory to put generated artifacts
      -r, --resource=<directory> The directory to put resource artifacts
      -s, --source=<directory> The directory to put Java source
      -e, --extension Enable SOAP 1.2 binding extension
      -q, --quiet Be somewhat more quiet
      -t, --show-traces Show full exception stack traces
      -l, --load-provider Load the provider and exit (debug utility)

      Attachments

        Issue Links

          Activity

            People

              rhn-support-asoldano Alessio Soldano
              jwhiting@redhat.com Jeremy Whiting
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: