cancel
Showing results for 
Search instead for 
Did you mean: 

problem using JCO within EJB

heiko_kst
Explorer
0 Kudos

hi,

i get the following exception making a JCO call from within an EJB:

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:\WINNT\system32\sapjcorfc.dll already loaded in another classloader]. java.library.path ...

the example worked at first, but after re-deploying the same EAR i get the exception. i also tried to undeploy/remove the EAR, but it didn't change anything.

os: windows 2000

jdk: 1.4.2

sap netweaver 2004

following jars are included in the EAR: aii_proxy_rt.jar, aii_util_misc.jar, sapjco.jar, SAPmdi.jar

thanks for your help!

heiko

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

Here is the solution for ur problem.

In the Application Project, select application-j2ee-engine.xml. Click on Reference and Add the following reference (com.sap.mw.jco)

Don't forget to reward the points

Regards,

Arvind Kugasia

akugusia@hcl.in

Former Member
0 Kudos

hi,

i think u have to add that jar files in the ear.expand the ear and click on application.xml and click on references and add that jar files and deploy that ear.i think this will solve ur problem.

Former Member
0 Kudos
Former Member
0 Kudos

Hi Heiko,

Welcome to SDN.

Make the application part of J2EE library.

This makes it accessible by all applications.

Regards,

Tanveer.

Mark helpful answers.

Former Member
0 Kudos

Hi

This error occurs because the libary has been loaded in some other classloader

It would be better if you deploy the JCO application as J2ee library , which makes in access globally and then give hard reference to the EAR project .

please see the link for developing a j2ee library

http://help.sap.com/saphelp_nw04/helpdata/en/9f/2ade3fc6c6ec06e10000000a1550b0/content.htm

Hope this helps , please do not forget to reward points

regards

rajeshkr