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,590
  • 2
  • 27
  • 34

3 Answers3

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
0

Works for me with java -cp %CD%\* org.apache.axis.wsdl.WSDL2Java after surrounding the classpath with double-quotes. You should be in the directory where the axis and jar dependencies are.

Matécsa Andrea
  • 532
  • 1
  • 6
  • 15
  • Try to always separate code from text and use different text styles like bold and italics to highlight specific parts of your message. It makes it for users easier to read and understand your message. Also, try to make your text more accurate and explicit. No matter how good the intention of the comment is, if the above do not hold, then people will not read it or appreciate it and never give you credit for it :) – Matécsa Andrea Jun 18 '22 at 07:29
  • Hi, I'm afraid this answer looks to be the same as another answer. It is also only valid on Windows. – mjaggard Jun 21 '22 at 09:04