cancel
Showing results for 
Search instead for 
Did you mean: 

Java Mapping - Error

Former Member
0 Kudos

Hi Experts,

I am running basic Java Mapping scenario. Then will switch to my requirement.


Right now Mapping is -- Input field [String ] – "Name"            ------------ >  Output Field[String]  - "NAme"

I have PI 7.1 EHP 1 system. As advised by jdk1.5.0_22 --  jre1.5.0_22 and Netbeans is installed in the system.
Environmental variables are  also set.

I have added PI 7.1  jar file -- com.sap.xpi.ib.mapping.lib  in the Netbeans Libraries.

Dervied from --  \\HOST\usr\sap\PIQ\DVEBMGS01\j2ee\cluster\bin\ext\com.sap.xi.mapping.api.lib\lib

Attached Java code , I am using to run the sceanrio.

But it showing below error each time.

xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
  <SAP:Category>Application</SAP:Category>
  <SAP:Code area="MAPPING">LINKAGE_ERROR</SAP:Code>
  <SAP:P1>mira/MappingCode</SAP:P1>
  <SAP:P2>java.lang.NoClassDefFoundError: mira/MappingCode (</SAP:P2>
  <SAP:P3>wrong name: MappingCode)</SAP:P3>
  <SAP:P4 />
  <SAP:AdditionalText />
  <SAP:Stack>Linkage error while loading class mira/MappingCode; java.lang.NoClassDefFoundError: mira/MappingCode (wrong name: MappingCode)</SAP:Stack>
  <SAP:Retry>M</SAP:Retry>
  </SAP:Error>

Already followed some blogs like Anupam Ghosh’ blog  . Finally raising this issue.

http://scn.sap.com/thread/3189877

Please suggest or give idea to run basic Java Mapping sceanrio.

Thanks..

Accepted Solutions (1)

Accepted Solutions (1)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Anshul,

                Please check my response in these threads

http://scn.sap.com/thread/3206875

http://scn.sap.com/thread/3204957

The error is "Linkage error while loading class mira/MappingCode; java.lang.NoClassDefFoundError: mira/MappingCode". This error might result if there is any package statement used by default in the Netbeans IDE. Check this properly or use a package statement in your code.

Could you explain why the error is showing the path "mira/MappingCode" and not only "mappingCode"?  This may have something to do with the path where Netbeans is saving the class file,and the same is not available in PI server.

If this also does not work then install eclipse/NWDS and create new enviornment as shown in  my article for PI 7.0

http://wiki.sdn.sap.com/wiki/x/BQj2D

Under this article you will find a comment section. Check that section also.

Regards

Anupam

Former Member
0 Kudos

Hi Anupam,

Thanks for the response.

Could you explain why the error is showing the path "mira/MappingCode" and not only "mappingCode"?  This may have something to do with the path where Netbeans is saving the class file,and the same is not available in PI server.

It is showing in case of "Imported Archive"  , like below

NAME                                                                          PATH

MappingCode.class                                                       Mira/

MappingCode.java                                                         Mira/

Note : - Mira is name of ZIP folder.

Thanks.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Anshul ,

                   add package statement at begining of  your code

package Mira;

This might resolve the error. I guess this error is due to the fact that PI server is not getting the directory Mira within the server. Then export as a jar file (and not zip). Check this link for more on package statement http://docs.oracle.com/javase/tutorial/java/package/createpkgs.html

Try this, else need to install eclipse and recompile the code.

I guess the default settings in Netbeans may have something to do with this error.

Regards

Anupam

Answers (1)

Answers (1)

nageshwar_reddy
Contributor
0 Kudos

Check the java version that is actually being used in the server by going to http://<server>:<port>/rep => Administration => Repository => General Information => System Environment => Java Runtime. There are other ways to find out the version. If you are not able to access this link, you can take basis help to get the actual version.Ensure that the same version is being used by you in netbeans.

Can you also check if you have anything in the Manifest.mf in the jar file?