4

Our clients are using Axis 1.0 to build a client to our WCF based SOAP services.

It's not working for them and I want to run the WSDL2Java client locally on my machine so I can experiment.

I already have the JDK installed on my machine, java works from the command line.

Reading the installation guide for Axis 1.0, and using the -cp switch, I get the following:

java -cp E:\Temp\Axis\xml-axis-10\lib org.apache.axis.wsdl.WSDL2Java

(that path contains all the jar files)

And get the following:

Error: Could not find or load main class org.apache.axis.wsdl.WSDL2Java

Anybody know what I'm doing wrong?

UPDATE1:

I've tried setting the user CLASSPATH to:

C:\Program Files\Java\jdk1.7.0_09\lib;E:\Temp\Axis\xml-axis-10\lib

No dice, same error.

UPDATE2:

If I try this command line, I get something different, it now appear to be loading the class:

E:\Temp>java -cp E:\Temp\Axis\xml-axis-10\lib\axis.jar org.apache.axis.wsdl.WSDL2Java
Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.commons.logging.LogFactory
        at org.apache.axis.components.logger.LogFactory$1.class$(LogFactory.java:68)
        at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:84)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:80)
        at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:72)
        at org.apache.axis.i18n.ProjectResourceBundle.<clinit>(ProjectResourceBundle.java:92)
        at org.apache.axis.i18n.MessagesConstants.<clinit>(MessagesConstants.java:71)
        at org.apache.axis.utils.Messages.<clinit>(Messages.java:81)
        at org.apache.axis.wsdl.WSDL2Java.<clinit>(WSDL2Java.java:106)

E:\Temp>
RoboJ1M
  • 1,510
  • 2
  • 26
  • 32

2 Answers2

3

If you only provide folders in your classpath, the jar files will not be loaded. You should use jar name (as in your UPDATE2) or wildcards (have a look here and here).

As for your problem with missing LogFactory - you should add to your classpath a proper jar (eg. commons-logging.jar, try http://www.findjar.com).

Community
  • 1
  • 1
Adam K.
  • 56
  • 2
  • Excellent, setting the path to `C:\Program Files\Java\jdk1.7.0_09\lib\*;E:\Temp\Axis\xml-axis-10\lib\*` worked, thank you very much – RoboJ1M Jan 22 '13 at 16:41
2

Try this: java -cp %CD%\* org.apache.axis.wsdl.WSDL2Java

The jar for logging is already in the lib directory. The above command should work if you are in the lib directory.

Harry
  • 21
  • 1