users@jax-rpc.java.net

Help... ClassNotFoundException when running wscompile

From: Mark A Bradbury <Mark_A_Bradbury_at_raytheon.com>
Date: Mon, 09 May 2005 15:30:45 -0500

Help! I'm getting an error when running wscompile from ant.
I've tried several variations on the classpath parameter and nothing
seems to help.

Here's the ant task specifics...
  <path id='compile.path'>
      <fileset dir='${ext}'>
          <include name='**/*.jar'/>
          <include name='**/*.zip'/>
      </fileset>
      <fileset dir='${lib}'>
          <include name='**/*.jar'/>
      </fileset>
  </path>

  <taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile">
      <classpath>
          <fileset dir="/jwsdp-1.5">
              <include name='**/*.jar'/>
          </fileset>
      </classpath>
 </taskdef>

  <!-- Compilation of the server part -->
  <target name="compile-server" depends="init">
      <javac srcdir="${src}"
                destdir="${classes}"
                debug='true'
                deprecation='true'
                verbose='false'
                nowarn='true'
                source='1.4'
                target='1.4'>
          <include name="bar/webservice/**"/>
          <classpath>
              <path refid="compile.path"/>
          </classpath>
      </javac>
  </target>

  <target name="generate-wsdl" depends="compile-server">
      <!-- Generate the WSDL file -->
      <wscompile
          keep="true"
          base="${classes}"
          sourceBase="${server_generated_dir}"
          server="true"
          xPrintStackTrace="true"
          verbose="true"
          config="${config.file}"
          model="${classes}/${model}">
          <classpath>
              <path refid="compile.path"/>
              <fileset dir="${classes}">
                  <include name="bar/webservice/ejb/WebService.class"/>
              </fileset>
          </classpath>
      </wscompile>
  </target>

  <!-- Target that compiles and generates everything -->
  <target name="compile" depends="generate-wsdl"/>

And here's the output from the build...
/foo/build> ant -f build_ws.xml compile
********************************
* ANT_HOME = c:/apache-ant-1.6.3beta1
* ANT_LIB = c:/apache-ant-1.6.3beta1/lib
* JAVA_HOME = c:/j2sdk1.4.2_07
* CYGHOME = c:/Documents and Settings/mbradbu
* LOCALCLASSPATH = c:/apache-ant-1.6.3beta1/lib/ant-launcher.jar
********************************
Buildfile: build_ws.xml

init:

compile-server:

generate-wsdl:
[wscompile] command line: wscompile -d C:\foo\classes -gen:server -keep
-model C:\foo\classes\model-wsdl-foo.xml.gz -s C
:\foo\src\generated\server -verbose -Xprintstacktrace
C:\foo\config\ws\config.xml -classpath C:\foo\ext\
LoginEnabler.jar;C:\foo\ext\activation.jar;C:\foo\ext\arcims_jconnect.jar;C:\foo\ext\axis-ant.jar;C:\foo\ext\axis.jar;C:
\foo\ext\bsf.jar;C:\foo\ext\castor-0.9.5.jar;C:\foo\ext\cmp.jar;C:\foo\ext\commons-beanutils.jar;C:\foo\ext\commons-coll
ections.jar;C:\foo\ext\commons-dbcp.jar;C:\foo\ext\commons-digester.jar;C:\foo\ext\commons-discovery.jar;C:\foo\ext\comm
ons-fileupload.jar;C:\foo\ext\commons-lang.jar;C:\foo\ext\commons-logging.jar;C:\foo\ext\commons-net-1.2.2.jar;C:\foo\ex
t\commons-pool.jar;C:\foo\ext\commons-resources.jar;C:\foo\ext\commons-validator.jar;C:\foo\ext\concurrent.jar;C:\foo\ex
t\dbunit-2.1.jar;C:\foo\ext\jai_codec.jar;C:\foo\ext\jai_core.jar;C:\foo\ext\jax-qname.jar;C:\foo\ext\jaxp-api.j
ar;C:\foo\ext\jaxrpc-api.jar;C:\foo\ext\jaxrpc-impl.jar;C:\foo\ext\jaxrpc-spi.jar;C:\foo\ext\jaxrpc.jar;C:\foo\ext\jboss
\jboss-common-jdbc-wrapper.jar;C:\foo\ext\jboss\jbossall-client.jar;C:\foo\ext\jms.jar;C:\foo\ext\jstl.jar;C:\foo\ext\jt
s-1.4.1.jar;C:\foo\ext\junit.jar;C:\foo\ext\mail.jar;C:\foo\ext\objectplanet.jar;C:\foo\ext\relaxngDatatype.jar;C:\foo\e
xt\saaj-api.jar;C:\foo\ext\saaj-impl.jar;C:\foo\ext\saaj.jar;C:\foo\ext\saxpath.jar;C:\foo\ext\sdoapi.jar;C:\foo\ext\sta
ndard.jar;C:\foo\ext\struts-adapter.jar;C:\foo\ext\struts-legacy.jar;C:\foo\ext\struts.jar;C:\foo\ext\swiftmq.jar;C:\foo
\ext\tar.jar;C:\foo\ext\wsdl4j.jar;C:\foo\ext\xalan.jar;C:\foo\ext\xercesImpl.jar;C:\foo\ext\xml-apis.jar;C:\foo\ext\xsdlib.jar;
C:\foo\lib\concurrent.jar;C:\foo\lib\jbossall-client.jar;C:\foo\lib\jts-1.4.1.jar;C:\foo\lib\xsl.jar;C:\foo\classes\bar\webservice\ej
b\WebService.class
[wscompile] [creating model: WebService]
[wscompile] [creating service: WebService]
[wscompile] RmiModeler error: java.lang.ClassNotFoundException:
bar$webservice$ejb$WebService
[wscompile] at
com.sun.xml.rpc.processor.modeler.rmi.RmiModeler.modelPort(RmiModeler.java:685)
[wscompile] at
com.sun.xml.rpc.processor.modeler.rmi.RmiModeler.buildEncodedModel(RmiModeler.java:523)
[wscompile] at
com.sun.xml.rpc.processor.modeler.rmi.RmiModeler.buildModel(RmiModeler.java:459)
[wscompile] at
com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:88)
[wscompile] at
com.sun.xml.rpc.processor.Processor.runModeler(Processor.java:63)
[wscompile] at
com.sun.xml.rpc.tools.wscompile.CompileTool.run(CompileTool.java:714)
[wscompile] at com.sun.xml.rpc.util.ToolBase.run(ToolBase.java:43)
[wscompile] at
com.sun.xml.rpc.tools.ant.Wscompile.execute(Wscompile.java:746)
[wscompile] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[wscompile] at org.apache.tools.ant.Task.perform(Task.java:364)
[wscompile] at org.apache.tools.ant.Target.execute(Target.java:341)
[wscompile] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[wscompile] at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1206)
[wscompile] at
org.apache.tools.ant.Project.executeTarget(Project.java:1175)
[wscompile] at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:37)
[wscompile] at
org.apache.tools.ant.Project.executeTargets(Project.java:1058)
[wscompile] at org.apache.tools.ant.Main.runBuild(Main.java:668)
[wscompile] at org.apache.tools.ant.Main.startAnt(Main.java:187)
[wscompile] at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
[wscompile] at
org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
[wscompile]
[wscompile] CAUSE:

[wscompile] java.lang.ClassNotFoundException: bar$webservice$ejb$WebService
[wscompile] at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
[wscompile] at java.security.AccessController.doPrivileged(Native
Method)
[wscompile] at
java.net.URLClassLoader.findClass(URLClassLoader.java:187)
[wscompile] at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
[wscompile] at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
[wscompile] at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
[wscompile] at java.lang.Class.forName0(Native Method)
[wscompile] at java.lang.Class.forName(Class.java:219)
[wscompile] at
com.sun.xml.rpc.processor.modeler.rmi.RmiUtils.getLoadableClassName(RmiUtils.java:78)
[wscompile] at
com.sun.xml.rpc.processor.modeler.rmi.RmiUtils.getLoadableClassName(RmiUtils.java:84)
[wscompile] at
com.sun.xml.rpc.processor.modeler.rmi.RmiUtils.getLoadableClassName(RmiUtils.java:84)
[wscompile] at
com.sun.xml.rpc.processor.modeler.rmi.RmiUtils.getLoadableClassName(RmiUtils.java:84)
[wscompile] at
com.sun.xml.rpc.processor.modeler.rmi.RmiUtils.getLoadableClassName(RmiUtils.java:84)
[wscompile] at
com.sun.xml.rpc.processor.modeler.rmi.RmiUtils.getLoadableClassName(RmiUtils.java:84)
[wscompile] at
com.sun.xml.rpc.processor.modeler.rmi.RmiUtils.getRealName(RmiUtils.java:54)
[wscompile] at
com.sun.xml.rpc.processor.modeler.rmi.RmiModeler.modelPort(RmiModeler.java:676)
[wscompile] at
com.sun.xml.rpc.processor.modeler.rmi.RmiModeler.buildEncodedModel(RmiModeler.java:523)
[wscompile] at
com.sun.xml.rpc.processor.modeler.rmi.RmiModeler.buildModel(RmiModeler.java:459)
[wscompile] at
com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:88)
[wscompile] at
com.sun.xml.rpc.processor.Processor.runModeler(Processor.java:63)
[wscompile] at
com.sun.xml.rpc.tools.wscompile.CompileTool.run(CompileTool.java:714)
[wscompile] at com.sun.xml.rpc.util.ToolBase.run(ToolBase.java:43)
[wscompile] at
com.sun.xml.rpc.tools.ant.Wscompile.execute(Wscompile.java:746)
[wscompile] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[wscompile] at org.apache.tools.ant.Task.perform(Task.java:364)
[wscompile] at org.apache.tools.ant.Target.execute(Target.java:341)
[wscompile] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[wscompile] at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1206)
[wscompile] at
org.apache.tools.ant.Project.executeTarget(Project.java:1175)
[wscompile] at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:37)
[wscompile] at
org.apache.tools.ant.Project.executeTargets(Project.java:1058)
[wscompile] at org.apache.tools.ant.Main.runBuild(Main.java:668)
[wscompile] at org.apache.tools.ant.Main.startAnt(Main.java:187)
[wscompile] at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
[wscompile] at
org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
[wscompile] error: RmiModeler error: java.lang.ClassNotFoundException:
bar$webservice$ejb$WebService


BUILD FAILED
C:\foo\build\build_ws.xml:89: wscompile failed

Total time: 3 seconds
/foo/build>

As you can see... the class file "bar.webservice.ejb.WebService" is
specified in the classpath parameter to wscompile, but it doesn't find it.
I'm doing this build in a cygwin terminal on a Windows 2000 Pro system.
Any help would be much appreciated.
Thanks,
Mark