+ Start a Discussion
crocodilecrocodile 

Error. Unable to generate java api for my wsdl?....

Hi,

 

      when i ran the command to generate java api for my wsdl file, Getting errors:

 

Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.commons.logging.LogFactory
        at org.apache.axis.components.logger.LogFactory.class$(LogFactory.java:45)
        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>(ProjectResourceBundle.java:53)
        at org.apache.axis.i18n.MessagesConstants.<clinit>(MessagesConstants.java:32)
        at org.apache.axis.utils.Messages.<clinit>(Messages.java:36)
        at org.apache.axis.wsdl.WSDL2Java.<clinit>(WSDL2Java.java:112)

 

The command i used is: java org.apache.axis.wsdl.WSDL2Java Student.wsdl

 

The jar files i included are:

 

activation.jar

axis.jar

axis-ant.jar

axis-schema.jar

commons-discovery-0.2.jar

commons-logging-1.0.4 .jar

jaxrpc.jar

log4j-1.2.8.jar

log4j.properties

mail.jar

saaj.jar

sfdc.jar

wsdl4j-1.5.1.jar

 

 

Can any one please guide me how to generate the API succesfully

Thanks in adv,

-Vissu

 

 

 


 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell
see the section in the API docs, it explains how to set the classpath, you don't appear to be doing.

All Answers

SuperfellSuperfell
see the section in the API docs, it explains how to set the classpath, you don't appear to be doing.
This was selected as the best answer
crocodilecrocodile

Thanks Simon for the reply.

 

I have already included all the required jar files:

 

C:\axis-1_3\lib\activation.jar;

C:\axis-1_3\lib\axis.jar;

C:\axis-1_3\lib\axis-ant.jar;

C:\axis-1_3\lib\axis-schema.jar;

C:\axis-1_3\lib\commons-discovery-0.2.jar;

C:\axis-1_3\lib\commons-logging-1.0.4.jar;

C:\axis-1_3\lib\jaxrpc.jar;

C:\axis-1_3\lib\log4j-1.2.8.jar;

C:\axis-1_3\lib\mail.jar;

C:\axis-1_3\lib\saaj.jar;

C:\axis-1_3\lib\wsdl4j-1.5.2.jar;

C:\axis-1_3\lib\wsdl4j.jar;

 

and i have the enterprise.wsdl.xml file in C:\testing

 

the command i entered is :

 

C:\testing>java -classpath C:\axis-1_3\lib\activation.jar;C:\axis-1_3\lib\axis.jar;C:\axis-1_3\lib\a
xis-ant.jar;C:\axis-1_3\lib\axis-schema.jar;C:\axis-1_3\lib\commons-discovery-0.2.jar;C:\axis-1_3\li
b\commons-logging-1.0.4.jar;C:\axis-1_3\lib\jaxrpc.jar;C:\axis-1_3\lib\log4j-1.2.8.jar;C:\axis-1_3\l
ib\mail.jar;C:\axis-1_3\lib\saaj.jar;C:\axis-1_3\lib\wsdl4j-1.5.2.jar;C:\axis-1_3\lib\wsdl4j.jar; or
g.apache.axis.wsdl.WSDL2JAVA enterprise.wsdl

 

Then got the error saying:


Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/axis/wsdl/WSDL2JAVA

 

Please guide me how to rectify this error.

 

Thanks in adv,

-Vissu

SuperfellSuperfell
class names are case sensitive in Java, i don't think its WSDL2JAVA, check the axis docs.
visualforce_devvisualforce_dev

C:\testing>java -classpath C:\axis-1_3\lib\activation.jar;C:\axis-1_3\lib\axis.jar;C:\axis-1_3\lib\a xis-ant.jar;C:\axis-1_3\lib\axis-schema.jar;C:\axis-1_3\lib\commons-discovery-0.2.jar;C:\axis-1_3\li b\commons-logging-1.0.4.jar;C:\axis-1_3\lib\jaxrpc.jar;C:\axis-1_3\lib\log4j-1.2.8.jar;C:\axis-1_3\l ib\mail.jar;C:\axis-1_3\lib\saaj.jar;C:\axis-1_3\lib\wsdl4j-1.5.2.jar;C:\axis-1_3\lib\wsdl4j.jar; org.apache.axis.wsdl.WSDL2Java -a enterprise.wsdl -O -1

 Hi

 

Check whether this works...

 

I am able to do this..

junaid_ajjunaid_aj

It will be better if you set the in the Environmental Variable of your computer.

 

for Example

Goto Environmental variable and click on new on used variable

 

give variable name as  CLASSPATH

 give variable value as D:\axis-1_4\lib\axis.jar;D:\axis-1_4\lib\axis-ant.jar;D:\axis-1_4\lib\commons-discovery-0.2.jar;D:\axis-1_4\lib\commons-logging-1.0.4.jar;D:\axis-1_4\lib\jaxrpc.jar;D:\axis-1_4\lib\log4j-1.2.8.jar;D:\axis-1_4\lib\saaj.jar;D:\axis-1_4\lib\wsdl4j-1.5.1.jar;D:\axis-1_4\lib\tools.jar;

 

Make sure that all the Jar are available in the Defined Directroy.

and then goto command prompt and type this 

 

C:\testing>java org.apache.axis.wsdl.WSDL2Java -o . -s -p com.sample enterprise.wsdl

 

may be this can help you.