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
ProlayProlay 

Exception in thread "main" java.lang.NoClassDefFoundError: com/sforce/ws/ConnectionException

Dear Flocks,

I am facing this issue and created the GitHub ticket on the same. The GitHub link is ​https://github.com/forcedotcom/wsc/issues/117 (https://github.com/forcedotcom/wsc/issues/117).

Thanks in Advance.
Best Answer chosen by Prolay
James LoghryJames Loghry
Sounds like either you generated the wsc.jar file incorrectly, or your class path is set incorrectly and the java command can't find the wsc.jar file.  For more info on generating the wsc jar, see here: https://github.com/forcedotcom/wsc

All Answers

James LoghryJames Loghry
Sounds like either you generated the wsc.jar file incorrectly, or your class path is set incorrectly and the java command can't find the wsc.jar file.  For more info on generating the wsc jar, see here: https://github.com/forcedotcom/wsc
This was selected as the best answer
ProlayProlay
I followed these steps to generate Partner.jar file -

I downloaded the Partner WSDL from the Sandbox and saved it as Partner.wsdl file in the local directory.

According to the latest resolved issue of the GitHub forum #92 (https://github.com/forcedotcom/wsc/issues/92), I downloaded the Uber JAR file from the location http://central.maven.org/maven2/com/force/api/force-wsc and the StringTemplate Jar from 
http://www.stringtemplate.org/

According to the http://sforcehacks.blogspot.in/2013/04/building-partnerjar-api-file.html, (http://sforcehacks.blogspot.in/2013/04/building-partnerjar-api-file.html) we require the latest Rhino library which I downloaded from http://mvnrepository.com/artifact/rhino/js.

We also need the Tools.jar of the latest JDK. I am using JDK 8.66. I included the Tools.jar path while generating the Partner.jar

I used these jar files and the WSDL file to generate Partner.jar with the below-mentioned files
A. force-wsc-35.2.5-uber.jar
B. js-1.7R2.jar
C. ST-4.0.8.jar
D. sandbox-partner.wsdl

The output as below screen shot
User-added image


Then I compile the PartnerSamples.java to generate the class file. Please see the screen shot below.

User-added image

While running the Class file, I am getting the following error

User-added image

According to the Oracle JAVA CLASSPATH document https://docs.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html, I set the CLASSPATH variable as C:\Program Files\Java\jdk1.8.0_66\lib\*;C:\Program Files\Java\jre1.8.0_66\lib\*; *;

15 days before when I tried the same thing for the BULK API, it worked fine.

Thanks in Advance.
ProlayProlay
Thank you, James Loghry. The issue was incorrect  CLASSPATH setting while running the java class. I set the command line CLASSPATH as


set CLASSPATH=.*;"C:\Program Files\Java\jdk1.8.0_66\lib\*";C:\Program Files\Java\jre1.8.0_66\lib\*";.\force-wsc-35.0.0.jar;.\partner.jar;