javaspringsapjco3

SAP RFC call using java spring application


ClassNotFoundException: com.sap.conn.jco.JCoException class is not getting while making RFC calls to SAP system through java spring web application.

SEVERE: Servlet /autobot threw load() exception java.lang.ClassNotFoundException: com.sap.conn.jco.JCoException


Solution

  • Put the sapjco3.jar file into the class path of your Web Application Server.

    I do not recommend to put it into your web application archive (.ear/.war) itself, because the sapjco3.jar file can only be loaded once due to its dependency to native shared libraries which can only be loaded once. Otherwise, if putting it into your web application archive, the first invocation of your app will succeed but following loads of your app or of other apps, which also use the JCo, won't work. In this case the JCo initialization will fail because the native shared library sapjco3.dll / libsapjco3.so cannot be loaded twice.