Skip to Content

problem using JCO within EJB

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Apr 26, 2006 at 04:47 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 26, 2006 at 07:27 PM

    Hi Heiko,

    Welcome to SDN.

    Make the application part of J2EE library.

    This makes it accessible by all applications.

    Regards,

    Tanveer.

    Mark helpful answers.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 27, 2006 at 04:32 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 28, 2006 at 02:43 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 04, 2006 at 11:46 AM

    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

    Add comment
    10|10000 characters needed characters exceeded