Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAP JCO Connector Error

Former Member
0 Kudos

I am using Liferay Portal. Trying to Sap Using SAP Jco. I follwed and done all the procedure as said in the documentation.I am getting this same error what should i do to clear this problem plz anyone guide the steps to foll0w

Caused by: java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'

JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [Native Library C:\WINDOWS\system32\sapjcorfc.dll already loaded in another classloader]. java.library.path [C:\liferay-portal-5.2.1\tomcat-6.0.18\jre1.5.0_17\win\bin;.;C:\WINDOWS\system32;C:\WINDOWS]

2 REPLIES 2

jordi_escodaruiz
Active Participant
0 Kudos

Hi:

I faced the same problem some time ago.

The JCO library has to be loaded only once.

You probably included JCO library in your project.

Try to remove JCO library from your project and put it as a global library (where it is loaded only once)

Best regards

Jordi

jordi_escodaruiz
Active Participant
0 Kudos

I try to explain better.

Be sure sapjco.jar is not included in the application. Doing so will lead

the system to load more than one time the SAP Java Connector. *Sapjco.jar

has to be loaded only once in the server.*

To do so (in Windows & Tomcat environment):

1-Be sure sapjco.jar is not included in the WEB-INF folder.

2-Put sapjcorfc.dll and librfc32.dll in c:\Windows\system32

3-Put sapjco.jar in c:\Tomcat\common\lib

4-Add a reference to sapjco.jar in the project (In Eclipse:

Project/Properties/Java Build Path, Tab Libraries, Add External JARs.

5-Compile and deploy the application. Generate War file. If ant gives

problems, add proper command to find sapjco.jar (section <path

id="path.base">, <include name="sapjco.jar">)

6-Load the WAR file in Tomcat.

7-Stop and Start Tomcat.

8-Run the application.