• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling SalesForce platform from java code

 
Palak Agarwal
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2895
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic