Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

ClassNotFoundException using Java2WSDL command

Thread view: 
rhimbo - 09 Mar 2006 01:03 GMT
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.....
Bart Cremers - 09 Mar 2006 07:14 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.