Java2WSDL java.lang.ClassNotFoundException

I try to make WSDL with Axis Java2WSDL class, and get an error that my target class not found.

Here are the steps that I did:

I started with a tutorial from here:

A. I added the path to the files

enter image description here

to AXISCLASSPATH, and as well I added the path to the directory containing the files to the CLASSPATH var, so they look like

AXISCLASSPATH='C:\Program Files\Java\axis'\axis.jar;'C:\Program Files\Java\axis'\commons-discovery-0.2.jar;'C:\Program Files\Java\axis'\commons-loggin g.jar;'C:\Program Files\Java\axis'\jaxrpc.jar;'C:\Program Files\Java\axis'\saaj.jar;'C:\Program Files\Java\axis'\log4j-1.2.17.jar;'C:\Program Files\Java\axis'\xml-apis.jar;'C:\Program Files\Java\axis'\xercesImpl.jar;'C:\Program Files\Java\axis'\wsdl4j.jar

CLASSPATH=C:\Program Files\Java\axis\*;C:\Dev\webworkspace\WSDLGENTEST\src\test\*

  • i tried the path with no quotes, single and double quotes, to no effect.
  • C:\Dev\webworkspace\WSDLGENTEST\src\test\* - path to the working dir.

B. I created a sample interface I1

package test;

public interface I1 {
  public void f1();


C. I built the interface and seen the I1.class file in


D.I ran a command

 java org.apache.axis.wsdl.Java2WSDL -o wp.wsdl
 -n"urn:test" -p"test" "urn:test" test.I1

and got an error of

java.lang.ClassNotFoundException: test.I1 at$ Source) at$ Source) at Method) at Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.apache.axis.utils.ClassUtils$ at Method) at org.apache.axis.utils.ClassUtils.loadClass( at org.apache.axis.utils.ClassUtils.forName( at org.apache.axis.wsdl.fromJava.Emitter.setCls( at at org.apache.axis.wsdl.Java2WSDL.main(

  • I tried to run it from the


and also from


  • Traté de correr con

params, always getting the same error. He just seems to be not able to locate the file.

  • I updated the classpath with all conceivable permutations of the path and *:

CLASSPATH=C:\Program Files\Java\axis\*;C:\Dev\webworkspace\WSDLGENTEST\src;C:\Dev\webworkspace\WSDLGENTEST\src\*;C:\Dev\webworkspace\WSDLGENTEST\src\test\;C:\Dev\webworkspace\WSDLGENTEST\src\test\*;C:\Dev\webworkspace\WSDLGENTEST\src\test\I1.class

still thesame error.

E. I compiled and ran a sample java hello world class just to check the java and paths work - the helloworld class printed what it needed, but the Java2WSDL does not work.

C:\Dev\workworkspace\test1\bin>java -cp . test/c1 Picked up

What can be done to overcome it?


preguntado el 09 de septiembre de 13 a las 23:09

What version of java are you using? can you also tell us what version of wsdl4j is used? -

1 Respuestas

Had the same issue then I appended my CLASSPATH (my classpath also target all the axis jars) with '.' the current directory.


Then this worked out:

"%javabin%\java.exe" -cp %CLASSPATH% org.apache.axis.wsdl.Java2WSDL

Respondido 13 Oct 15, 08:10

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.