cancel
Showing results for 
Search instead for 
Did you mean: 

Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'

Former Member
0 Kudos

I am getting error, when another applicaion is using this JCO driver.

this2/28/07 11:11:52:288 IST] 51254d5d SystemErr R 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:\Program Files\IBM\Rational\SDP\6.0\runtimes\base_v51\bin;C:\Program Files\IBM\Rational\SDP\6.0\runtimes\base_v51\java/bin;C:\Program Files\IBM\Rational\SDP\6.0\runtimes\base_v51\java/jre/bin;C:\Program Files\IBM\Rational\SDP\6.0\eclipse\jre\bin;.;C:\Program Files\IBM\Rational\SDP\6.0\eclipse\jre\bin;C:\ORACLE\ORA92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\SQLLIB\BIN;C:\SQLLIB\FUNCTION;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Rational\common;C:\RightNowApp\JCO\JCO2.1.7\sapjcorfc.dll;]

[2/28/07 11:11:52:288 IST] 51254d5d SystemErr R at com.sap.mw.jco.JCO.<clinit>(JCO.java:776)

i had tryied all the possiblities for that still iam not getting,

please can u solve my problem

Sunil

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hello Sunil.

There are two possible solutions to the problem you are having.

Solution 1. Remove the sapjcorfc.dll from the system32 directory in windows and copy it into the lib folders of your projects individually. That way each project will have its own middleware layer. The sapjcorfc.dll needs to be in the same directory as sapjco.jar, and as I said you'll need to have them separately for each and every one of your projects.

Solution 2. Is provided courtesy of Vladimir Pavlov. Read this for the solution.

Good Luck.

Rudy

Former Member
0 Kudos

hi

Former Member
0 Kudos

If you have to run two applications using JCO, manually loading the dlls may be a solution.

Manually loading maybe a good way to go:

System.loadLibrary();

You can test if the dlls have been loaded.

Dennis

Former Member
0 Kudos

Hi Dennis,

I have used that System.loadLibrary();

but it is giving the error

java.lang.UnsatisfiedLinkError: Native Library C:\WINDOWS\system32\sapjcorfc.dll already loaded in another classloader

[2/28/07 14:11:56:295 IST] 511c5b82 SystemErr R at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2111)

[2/28/07 14:11:56:295 IST] 511c5b82 SystemErr R at java.lang.ClassLoader.loadLibrary(ClassLoader.java:2025)

[2/28/07 14:11:56:295 IST] 511c5b82 SystemErr R at java.lang.Runtime.loadLibrary0(Runtime.java:824)

[2/28/07 14:11:56:295 IST] 511c5b82 SystemErr R at java.lang.System.loadLibrary(System.java:908)

Former Member
0 Kudos

Sunil,

Try to create new JCo connections and give the neccesary input corectly like J2EE Host Name and SAP Login details.

regards

Anil Dichpally

Former Member
0 Kudos

Anil,

That the problem is that, the dlls which we specified in one application is loaded into memory and another application is also want to load the same dlls in the memory. So it is giving the error like already using these dlls are in use by another class loader.

can u plz solve, i am unable to solve

Former Member
0 Kudos

HI,

Did u set the path to two dlls (librfc32.dll,sapjcorfc.dll)

regards

Guru

Former Member
0 Kudos

Hi Guru,

I set the path for these dlls. i think

That the problem is that, the dlls which we specified in one application is loaded into memory and another application is also want to load the same dlls in the memory. So it is giving the error like already using these dlls are in use by another class loader.

can u plz solve, i am unable to solve

Former Member
0 Kudos

I think the two applications you mentioned are running in two JVMs?

Because you manually load them, you can catch the exception and ignore it.

For instance,

try

{

System.loadLibrary();

}

catch( Throwable t )

{

t.printStackTrace();

}

Dennis