cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid Linkage Error in JAVA Mapping

Former Member
0 Kudos

Dear Experts,

I am trying to test the JAVA mapping compiled in NWDS but receiving the error


"LinkageError at JavaMapping.load(): Could not load class".

java.lang.NoClassDefFoundError: JSONXMLProject/bin/com/sap/json/ConvJson2Xml (wrong name: com/sap/json/ConvJson2Xml)

at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:735)

at java.lang.ClassLoader.defineClass(ClassLoader.java:716) at java.lang.ClassLoader.defineClass(ClassLoader.java:537)

at com.sap.aii.ib.server.mapping.execution.MappingLoader.findClass(MappingLoader.java:195)

Following are the details:

SAP PO 7.4

SP Stack Number 05

JDK Version jdk16

NWDS

SAP Enhancement Package 1 for SAP NetWeaver Developer Studio 7.3 SP10 PAT0000

1.Created the Project , Package and then class (Included the logic)

2. Included 1 JSON Jar file into my project and the Added to build path.

3.Exported the project as Archive File and saved in desktop

4.Imported into SAP PO system as Imported Archive

5.Could not observe the JSON jar file which i used as referenced JAR in NWDS

6.Tested in OM after referencing the JAVA class and found the above error.

I have JDK 5, 6 and 7 present in my local desktop and I am trying to export the compiled code using both JAVA SE 1.6 and 1.5 in NWDS seperatly after going several discussions.

Can any one hep me with the screenshots and tell me how to include all the reference jar files in exported project..

Regards..

Accepted Solutions (1)

Accepted Solutions (1)

former_member184720
Active Contributor
0 Kudos

Right click on Project Folder -> Build path-> Configure Build Path -> Order and Export ->select all the jar files that are required and then export it as a jar file.

In that jar(zip) file you should be able to see the class "ConvJson2Xml " at the location "JSONXMLProject/bin/com/sap/json"

If it doesn't work can you share the screenshot of your project navigation in NWDS?

Former Member
0 Kudos

Dear Hareesh,

I tried with several options, but still the issue persists.

Please refer to the attached document.

Please rename the doc by removing .txt. Its a word document.

Regards..

former_member184720
Active Contributor
0 Kudos

I see that you have the jar file under referenced library but can you try doing like this.

Right click on the project folder(root)->import-> General(Archive File)->select your jar file

This should add all the class files outside the reference libraries.

Former Member
0 Kudos

Dear Hareesh,

Tons of thanks....

You saved my whole day...

I did the same..  <<Right click on the project folder(root)->import-> General(Archive File)->select your jar file>>

Thanks...

Answers (1)

Answers (1)

anandvithal
Active Participant
0 Kudos

Hi,

Import the jars added in NWDS as Imported archive in ESR PI. The imported jars and the java mapping should be in the same SWCV.

Thanks,

Anand

Former Member
0 Kudos

Dear Anand,

I did exactly as you shared. As the JSON jar has number of classes, then in OM all the Classes had to be assigned. Then the linkage error went.

But in execution , it shows a new error that all the classes of the JSON jar has to be implemented with interface StremTransformation or AbstractTransformation.

I assume in the Operation Mapping I will use only 1 class as JAVA Class. Anyway I am attaching the document with navigation.

Do we have any other alternative??

Please rename the extension of the document by remove .txt

Regards

anandvithal
Active Participant
0 Kudos

Hi Rebecca,

I checked the attachment, i see an issue in below screenshot. I have indicated(in red) how it should actually look.

Make sure your are exporting the jar correctly and referring it correctly in your OM.

Thanks,

Anand