cancel
Showing results for 
Search instead for 
Did you mean: 

RFC

Former Member
0 Kudos

HI

when i tried to connect with SAP R/3 server using java

i got this error can any one help me to resolve this

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 [no sapjcorfc in java.library.path]. java.library.path [C:\j2sdk1.4.2_06\jre\bin\server;C:\j2sdk1.4.2_06\jre\bin;C:\j2sdk1.4.2_06\bin;D:\usr\sap\E60\JC01\j2ee\os_libs;C:\Program Files\CA\SC\CAWIN\;D:\oracle\ora92\jre\1.4.2\bin\client;D:\oracle\ora92\jre\1.4.2\bin;D:\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:\CA_APPSW;C:\PROGRA~1\CA\SC\CAM\bin;C:\Program Files\CA\DSM\bin;D:\usr\sap\E60\SCS00\exe;D:\usr\sap\E60\JC01\exe;D:\usr\sap\E60\SYS\exe\run]

with regards

Fahid

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

To resolve this error paste the following files in the respective areas

Windows NT, Windows 2000 and Windows 2003

There are different distribution packages for various JRE versions and hardware processors available:

sapjco-ntintel-2.1.8.zip for a 32-bit JRE running on a 32-bit INTEL x86 or a 64-bit INTEL Itanium processor

sapjco-ntia64-2.1.8.zip for a 64-bit JRE running on a 64-bit INTEL Itanium processor

sapjco-ntamd64-2.1.8.tgz for a 64-bit JRE running on a 64-bit AMD or INTEL x86 processor

To install JCo for Windows unzip the appropriate distribution package into an arbitrary directory {sapjco-install-path}.

If you already have an older librfc32.dll in the {windows-dir}\system32 directory, please replace it with the one that comes with JCo.

Then add {sapjco-install-path} to the PATH environment variable.

Finally, add {sapjco-install-path}\sapjco.jar to your CLASSPATH environment variable.

In your case you are missing the " librfc32.dll" in sytem32 folder.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi

i got the output but im not able to get P_Notif_No from SAP R/3

please help for this

the code i have written like this

package com.lti.railway;

import com.lti.railway.CreateNotificationProxy_PortType;

import com.lti.railway.Zcreate_Notification_Input;

import com.lti.railway.Zcreate_Notification_Output;

import com.sap.aii.proxy.framework.core.ApplicationFaultException;

import com.sap.aii.proxy.framework.core.SystemFaultException;

import com.sap.mw.jco.*;

public class RFCClass {

public String zcreate_Notification(String selList, String firstname, String lastname, String shortText) {

Zcreate_Notification_Output output = null;

try {

JCO.Client jcoclient =

JCO.createClient(

"800",

"SAPABAP",

"Newuser123",

"en",

"172.20.13.85",

"00"

);

jcoclient.connect();

Zcreate_Notification_Input input = new Zcreate_Notification_Input();

input.setP_Equip_No(selList);

input.setP_Notif_Desc(firstname);

input.setP_Notif_Type(lastname);

input.setP_String(shortText);

CreateNotificationProxy_PortType myproxy = new CreateNotificationProxy_PortType();

myproxy.messageSpecifier.setJcoClient(jcoclient);

output = myproxy.zcreate_Notification(input);

jcoclient.disconnect();

} catch (SystemFaultException e) {

e.printStackTrace();

} catch (ApplicationFaultException e) {

e.printStackTrace();

}

catch (Exception e1)

{

e1.printStackTrace();

}

return output.getP_Notif_No();

}

}

with regards

Fahid

Edited by: Muhammed Fahid on Aug 28, 2008 9:29 AM

Former Member
0 Kudos

Hi

i have resolved this error by following the below process

1) First i have selected the "application-j2ee-engine.xml" from the "Enterprise Application Project" Project.

2) I will find "Reference" folder

3) By selecting this folder click on "Add" button

4) Provide the package name of the JCO connector for R/3

Server inside "Reference Target", as "com.sap.mw.jco"

5) Inside "Reference Type" either you can select "hard"

or "weak"

6) "Reference Target Type" will be the library.

7) And "Provider Name" will be "sap.com"

Finally save and redeploy

with regards

Fahid

Edited by: Muhammed Fahid on Sep 1, 2008 8:40 AM

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

i have added the sapjcorfc.dll file and librfc32.dll in the WINDOWS\system32 folder and i have created sapjco folder and added sapjco.jar file "C:/SAPJCO". this path i have set in the environment variable as a classpath. but still it is showing the same error and when i refresh it shows java.lang.NoClassDefFoundError: null

with regards

Fahid