File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Calling SalesForce platform from java code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Calling SalesForce platform from java code" Watch "Calling SalesForce platform from java code" New topic
Author

Calling SalesForce platform from java code

Palak Agarwal
Greenhorn

Joined: Nov 02, 2011
Posts: 21
hi all,

I am trying to call salesforce platform through java servlet using SOAP connection. To do so i have imported WSC-20 jar etc. and set the class path as follows:


set classpath=.;C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\commons-cli-1.2.jar;C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\commons-io-1.4.jar;C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\jodconverter-2.2.2.jar;C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\jodconverter-cli-2.2.2.jar;C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\juh-3.0.1.jar;C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\jurt-3.0.1.jar;C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\ridl-3.0.1.jar;C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\slf4j-api-1.5.6.jar;C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\slf4j-jdk14-1.5.6.jar;C:\program Files\Apache Software Foundation\Tomcat 7.0\lib\unoil-3.0.1.jar;C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\xstream-1.3.1.jar;C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\enterprise.jar;C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\xstream-1.3.1.jar;C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\servlet-api.jar;C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\xstream-1.3.1.jar;C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\wsc-20.jar;C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\itext-2.1.7.jar;

But the servlet is throwing an exception

java.lang.NoClassDefFoundError: com/sforce/ws/ConnectionException java.lang.Class.getDeclaredConstructors0(Native Method) java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) java.lang.Class.getConstructor0(Class.java:2699) java.lang.Class.newInstance0(Class.java:326) java.lang.Class.newInstance(Class.java:308) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405) org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:197) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515) org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1824) java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)


Does anyone have idea why I am facing this kind of exception? Please reply

Thanks
Palak
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Have you ascertained that the missing class is in fact part of that jar file?

Also note that Tomcat does not use the CLASSPATH. TC 7 should pick up all classes from the lib directory, though; have you restarted TC after putting the jar file there?
Palak Agarwal
Greenhorn

Joined: Nov 02, 2011
Posts: 21
thanks a lot
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling SalesForce platform from java code
 
Similar Threads
context getAttribute code doubt
please help! classpath not working
What is the classpath for Tomcat 5.5?
JDBC on postgres
What is the classpath for Tomcat 5.5?