You have classpath issues. You must explicitly name all the jars in your classpath declaration (having them in the same directory isn't enough) in the command line (java -classpath ...) or set the classpath env variable before running java -jar.
A better idea would be to create a shell script (.bat in your windows case) that invokes the proper classpath when running your jar. That way you don't have to define the classpath env variable or write the whole classpath every time you want to run your jar. On 7/19/05, Dipty Maybhate <[EMAIL PROTECTED]> wrote: > Hi Everyone, > > I have implements a web services client using AXIS. I am trying to > make a jar file with all the jars and classes needed to run the > client. When I run the jar it throws the following exception > > C:\Program Files\Java\jdk1.5.0\bin>java -jar API.jar > Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/rpc/Se > rvice > > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > at java.security.SecureClassLoader.defineClass(SecureClassLoader.ja= > va:12 > 4) > at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) > at java.net.URLClassLoader.access$100(URLClassLoader.java:56) > at java.net.URLClassLoader$1.run(URLClassLoader.java:195) > 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 java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > > I have included all the axis - jar files along with my class files and > those generated using WSDL2Java > > c:/axis/axis-1_2_1/lib/axis-ant.jar > c:/axis/axis-1_2_1/lib/axis.jar > c:/axis/axis-1_2_1/lib/commons-discovery-0.2.jar > c:/axis/axis-1_2_1/lib/commons-logging-1.0.4.jar > c:/axis/axis-1_2_1/lib/jax-qname.jar > c:/axis/axis-1_2_1/lib/jaxrpc-1_1-fr-spec-api.jar > c:/axis/axis-1_2_1/lib/jaxrpc.jar > c:/axis/axis-1_2_1/lib/log4j-1.2.8.jar > c:/axis/axis-1_2_1/lib/saaj.jar > c:/axis/axis-1_2_1/lib/wsdl4j-1.5.1.jar > c:/axis/axis-1_2_1/lib/xmlsec-1.2.1.jar > Does anyone have an idea why there is a problem? > Thank you very much! > Dipty > -- Javier Gonzalez Nicolini
