ClassNotFoundException using Java2WSDL command

R

rhimbo

Hi folks,

I'm using the Apache AXIS Java2WSDL tool to generate a WSDL file from
my Java source file. I am getting a ClassNotFoundException exception.
I'm not sure if the problem is command line options or just a simple,
stupid mistake on my part. Here is the scenario:

I've abbreviated env variables and such to make this easier to read.
My CLASSPATH is set to include all the AXIS jars:

$ echo $CLASSPATH
..:/opt/ant/lib:/opt/java/lib:/opt/axis/lib/axis-ant.jar:
/opt/axis/lib/axis.jar:/opt/axis/lib/axis-schema.jar:
/opt/axis/lib/commons-discovery-0.2.jar:
/opt/axis/lib/commons-logging-1.0.4.jar:
/opt/axis/lib/jaxrpc.jar:/opt/axis/lib/log4j-1.2.8.jar:
/opt/axis/lib/saaj.jar:/opt/axis/lib/wsdl4j-1.5.1.jar:
/opt/axis/lib/commons-discovery-0.2.jar:
/opt/jaf/activation.jar

My AXIS installation is in:
$ pwd
/opt/axis/lib
$
$ ls
axis-ant.jar commons-discovery-0.2.jar log4j-1.2.8.jar
wsdl4j-1.5.1.jar
axis.jar commons-logging-1.0.4.jar log4j.properties
axis-schema.jar jaxrpc.jar saaj.jar
$

My working directory is here:

$ pwd
.../dev/family-accounts/src
$
$ ls
FamilyService.java

"FamilyService.java" is the source file from which I want to create a
WSDL. In the directory above, I execute the following command:

$ java org.apache.axis.wsdl.Java2WSDL -server \
-l /http://10.196.130.245:8080/axis/family-service.wsdl \
-o family-service.wsdl FamilyService.java

Here is the traceback:
java.lang.ClassNotFoundException: FamilyService.java
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
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:187)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:160)
at
org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:100)
at
org.apache.axis.wsdl.fromJava.Emitter.setCls(Emitter.java:2079)
at org.apache.axis.wsdl.Java2WSDL.run(Java2WSDL.java:584)
at org.apache.axis.wsdl.Java2WSDL.main(Java2WSDL.java:682)


It appears that it can't find my FamilyService.java class but I can't
figure out why. It's in the directory from which I'm executing the
command above. I've read several pages on the AXIS web site, IBM site
and others describing the Java2WSDL command.

Any help is appreciated. I sure hope this is not a silly, stupid pilot
error!

Thanks all.....
 
B

Bart Cremers

I'm just guessing here, never used axis or wsdl myself, but it looks
like it doesn't want a source file, but a class file. So compile your
source with javac and the feed the class to the program:

java org.apache.axis.wsdl.Java2WSDL -server \
-l /http://10.196.130.245:8080/axis/family-service.wsdl \
-o family-service.wsdl FamilyService

Don't forget the package name!

Regards,

Bart
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top