What does this JCO Exception mean?

What does this JCO Exception mean?

Three or four times a month, I am asked about a specific JCO connector exception that seems to confuse many people. If you've experienced the following exception, then read on for more insight:

java.lang.ExceptionInInitializerError: JCO.classInitialize(): 
Could not load middleware layer
'com.sap.mw.jco.rfc.MiddlewareRFC' JCO.nativeInit(): 
Could not initialize dynamic link library 
librfc. Found version "620.0.907" but required at least 
version "620.0.950".

This exception is misleading because most people start looking for the class com.sap.mw.jco.rfc.MiddlewareRFC which is part of the JCO file "sapjco.jar". After making sure this file is in the CLASSPATH, they attempt to re-run the application, only to get the same error. The answer lies in the fact that they have attempted to run JCo with files from different JCo versions.

SAP has been great about supporting JCo with ever-newer releases. Each release is a successive build upon the last, solving bugs and often adding new features to the connector. The trick is ensuring that you have completely removed ALL files installed from the previous release before attempting to run a new one.

The files in question are:

  • sapjco.jar
  • librfc32.dll
  • sapjcorfc.dll

    The exception above occurs when you have left the .dll files from a previous installation in the Windows/system32 directory, while trying to use the latest sapjco.jar file in my Java application. Obviously, my example

    • Requires Free Membership to View

      When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.

      Hannah Smalltree, Editorial Director

      By submitting your registration information to SearchSAP.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSAP.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

    Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.