function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDC LearningSFDC Learning 

Error While implementing Bulk API

Hi helpers,
Please give me the solution for this error . i am implementing bulk API and getting error during generation of partner.jar file. The error is
Error:Exception in thread "main" java.lang.NoClassDefFoundError
Please help me..

Thanks in advance
Best Answer chosen by SFDC Learning
SFDC LearningSFDC Learning
thank you for the efforts  James Loghry,

Actually Problem was with the version which i have used  force-wsc-35.0.0.jar replaced with force-wsc-29.0.0.jar


 

All Answers

James LoghryJames Loghry
Sounds like your classpath is messed up when you're generating the jar file.  Either you're missing a jar file or the path to the jar file(s) isn't correct.  These are always a pain to debug!  Here's some more info that's worth re-reading even if you've already gone through the instructions. https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_code_set_up_client.htm
SFDC LearningSFDC Learning
thank you for the reply ,
but i am following this page from begging for Bulk API , following this path "java -classpath pathToJar\wsc.jar com.sforce.ws.tools.wsdlc pathToWSDL\wsdlFilename .\wsdlGenFiles.jar" but constantly getting this error. 
 
James LoghryJames Loghry
I have to ask, are you changing "pathToWSDL\wsdlFilename" and "pathToJar\wsc.jar" to the file paths on your hard drive? If so, could you paste the exact command you're using (using the code formatting tool or < > button)?
SFDC LearningSFDC Learning
i have put the jar folder and wsdl file on desktop . and firing this command on terminal
 java -classpath force-wsc-35.0.0.jar com.sforce.ws.tools.wsdlc partner.wsdl .\wsdlGenFiles.jar
James LoghryJames Loghry
When you're in the terminal, what's your current directory? Your desktop?  Try fully qualifying the paths to your wsc jar, wsdl, and genfiles.jar to see if that works.

As an example:
java -classpath C:\Users\Sumaiya\Desktop\force-wsc-35.0.0.jar com.sforce.ws.tools.wsdlc C:\Users\Sumaiya\Desktop\partner.wsdl C:\Users\Sumaiya\Desktop\wsdlGenFiles.jar

 
James LoghryJames Loghry
Here's another thread I found that might help.. https://developer.salesforce.com/forums/?id=906F00000008zLZIAY
James LoghryJames Loghry
That one hints at a missing tools.jar file that you have to add to your classpath.. This one also hints at a missing rhino library. http://sforcehacks.blogspot.com/2013/04/building-partnerjar-api-file.html.  Solution: ADD ALL THE JARS111!!! :)
SFDC LearningSFDC Learning
thank you for the efforts  James Loghry,

Actually Problem was with the version which i have used  force-wsc-35.0.0.jar replaced with force-wsc-29.0.0.jar


 
This was selected as the best answer