Problem solve Get help with specific problems with your technologies, process and projects.

What does this JCO Exception mean?

This tip presents information on a specific JCO connector exception that seems to confuse many people.

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 here is Windows biased, such that if I were running on a UNIX platform, I would be using native libraries (.o, .so, etc.) instead of .dll files.

    To perform a successful install of a new JCo version, you simply need to remove the .dll files from the Windows/system32 directory and replace them with the libraries that come zipped in the newer version. Likewise, you must point your CLASSPATH to the latest sapjco.jar file, ensuring that the old version is not available from the CLASSPATH.

    Author Austin Sincock is a freelance Java/SAP consultant who contributes regularly to Web and print journals. He can be reached at austin@opensourceguru.com. Check out his book Enterprise Java for SAP


  • This was last published in December 2003

    Dig Deeper on SAP Java and J2EE

    PRO+

    Content

    Find more PRO+ content and other member only offers, here.

    Start the conversation

    Send me notifications when other members comment.

    By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

    Please create a username to comment.

    -ADS BY GOOGLE

    SearchManufacturingERP

    SearchOracle

    SearchDataManagement

    SearchAWS

    SearchBusinessAnalytics

    SearchCRM

    SearchContentManagement

    SearchFinancialApplications

    Close