• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting problem while creating Java client from command prompt

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone,

I am trying to create a java client for a web service. I have wsdl file. I am running following commands from a batch file
set AXIS_HOME=C:\axis
set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\wsdl4j-1.5.1.jar
set CLASSPATH=%CLASSPATH%;%AXIS_HOME\lib\commons-logging-1.0.4.jar
set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\commons-discovery-0.2.jar
set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\jaxrpc.jar
set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\saaj.jar
set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\axis.jar
java -classpath %CLASSPATH% org.apache.axis.wsdl.WSDL2Java -v -o d:\generate C:\axis\PQSSProvisioning.wsdl


I am getting following Exception

C:\Program Files\Java\jdk1.5.0\bin>java -classpath ;C:\axis\lib\wsdl4j-1.5.1.jar
;AXIS_HOME\lib\commons-logging-1.0.4.jar;C:\axis\lib\commons-discovery-0.2.jar;C
:\axis\lib\jaxrpc.jar;C:\axis\lib\saaj.jar;C:\axis\lib\axis.jar org.apache.axis.
wsdl.WSDL2Java -v -o d:\generate C:\axis\PQSSProvisioning.wsdl
Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.commons.lo
gging.LogFactory
at org.apache.axis.components.logger.LogFactory.class$(LogFactory.java:4
5)
at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:45
)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory
.java:41)
at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java
:33)
at org.apache.axis.i18n.ProjectResourceBundle.<clinit>(ProjectResourceBu
ndle.java:53)
at org.apache.axis.i18n.MessagesConstants.<clinit>(MessagesConstants.jav
a:32)
at org.apache.axis.utils.Messages.<clinit>(Messages.java:36)
at org.apache.axis.wsdl.WSDL2Java.<clinit>(WSDL2Java.java:112)

Please someone help me out, I am new to web service. Please suggest me some solution to create java client for the web service.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
It looks like you are missing the commons/logging JAR on your classpath.
The class org.apache.commons.logging.LogFactory is not found.
I see that you have included it on your classpath - is there some conflict somewhere?
Best wishes!
 
Pradeep Chaubey
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ivan,

I have eclipse 3.4 installed on my machine. As far as conflict is concerned, what it could be. I am unable to resolve. Please help.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!
Try looking at the following options instead of fiddling around with a batch file:
- Command line or Ant task: http://ws.apache.org/axis2/tools/1_4_1/CodegenToolReference.html
- The Axis Eclipse plugin: http://ws.apache.org/axis2/tools/1_4_1/eclipse/wsdl2java-plugin.html
- Maven WSDL2Java plugin: http://ws.apache.org/axis2/tools/1_4_1/maven-plugins/maven-wsdl2code-plugin.html

Since you are already using Eclipse, the plugin is, most likely, the easiest alternative.

Check JBoss Tattletale for a tool that can:
* Identify dependencies between JAR files
* Find missing classes from the classpath
* Spot if a class is located in multiple JAR files
* Spot if the same JAR file is located in multiple locations
* With a list of what each JAR file requires and provides
* Verify the SerialVersionUID of a class
* Find similar JAR files that have different version numbers
* Find JAR files without a version number
* Locate a class in a JAR file
* Get the OSGi status of your project
* Remove black listed API usage

Link: http://www.jboss.org/tattletale
Best wishes!
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you missed the close % of AXIS_HOME

set CLASSPATH=%CLASSPATH%;%AXIS_HOME\lib\commons-logging-1.0.4.jar

change to

set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\commons-logging-1.0.4.jar
 
reply
    Bookmark Topic Watch Topic
  • New Topic