1
votes

I am just learning axis and trying to deploy the stock example. However, when I typed in java org.apache.axis.client.AdminClient, I get the error:

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/rpc/Service Exception Caused by: java.lang.ClassNotFoundException: javax.xml.rpc.ServiceException at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: org.apache.axis.client.AdminClient. Program will exit.

I did what the installation said to set classpath as :

D:\axis\lib\axis.jar;D:\axis\lib\commons-discovery-0.2.jar;D:\axis\lib\commons-logging-1.0.4.jar;D:\axis\lib\jaxrpc.jar:D:\axis\lib\saaj.jar;D:\axis\lib\log4j-1.2.8.jar;C:\Program Files\Java\external-libs\xml-apis.jar;C:\Program Files\Java\external-libs\xercesImpl.jar;D:\axis\lib\wsdl4j-1.5.1.jar;D:\axis\lib\axis-ant.jar

but still I get the error. I am freaking out! Can anyone tell me what I overlooked to cause this?

1
Why are you learning Axis? It's long obsolete. - skaffman
I have never used Axis. However, did you try running it with java -cp <your_classpath_that_you_have_here> org.apache.axis.client.AdminClient instead of relying on your environment classpath? - CoolBeans
I don't know @skaffman - as much as the code behind Axis sucks, at least it works in non-OSGi stuff; eg: Enterprise Java. - javamonkey79
@skaffman - sorry, I'm a bit frustrated with CXF - I've started switching over a lot of WS clients to it and it works great in OSGi but I can't the darn thing to work in a WAR in glassfish v3. See here if you want to know what I'm talking about. - javamonkey79

1 Answers

3
votes

Did you make sure that all of these lib's outlined on your path are ACTUALLY where you are saying that they are? As far as I can tell, it's complaining that it can't find the ServiceException class which lives in the jaxrpc jar - so long as that is on your path where your classpath says it is and the jar actually contains the class in question then you should not be getting this. If you do have the jaxrpc jar where your classpath says I'd open it up with a decompiler and make sure the class is there in it - it could be that you got the wrong file, the wrong version, etc, etc.

Good luck.