cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping runtime exception java.lang null pointer exception

Former Member
0 Kudos

Hi,

i got Mapping runtime exception java.lang null pointer exception in MESSAGE MAPPING Level.See below that is the error.

RuntimeException in Message-Mapping transformation: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._RECYInvoice_to_SAPAccDocument_ method getCostCategory$[com.sap.aii.mappingtool.tf3.CBufIter@2449f384, com.sap.aii.mappingtool.tf3.CBufIter@731271b8, com.sap.aii.mappingtool.tf3.CBufIter@3fe8220d, com.sap.aii.mappingtool.tf3.CBufIter@2113a442]

how to resolve that issue. Please reply me .

Thanks & Regards

Bhaskar

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

i wrote the udf-getCostCategory.

i am getting error at udf level and output also NULL POINTER EXCEPTION.

Please gime solution for that.

Thanks & Regards

Bhaskar

baskar_gopalakrishnan2
Active Contributor
0 Kudos

First we need to see the UDF logic to suggest you about where you really getting this Null Pointer Exception. When you try to assign or access value from a null object, then you get this exception. You need to check whether you are passing value properly to the UDF input parameters. Also check your coding line by line by debugging. You can use log trace methods to debug the line easily. 

You can add debug statement as below for logging

Example:

container.getTrace().addInfo("your message");

You might also want to check this link for writing log traces using container object in the UDF.

http://help.sap.com/saphelp_dimp50/helpdata/en/78/b4ea10263c404599ec6edabf59aa6c/content.htm

iaki_vila
Active Contributor
0 Kudos

Hi Bhaskara,

Take the source xml from sxmb_moni and put in the test tab on message mapping or/and opertation mapping in order to determine where the error could be. Have you checked that the operation mapping has assigned some kind of mapping?

Regars,

Former Member
0 Kudos

Hi,

U r using any UDF- getCostCategory??

Chk the mapping output for the same

Thanks

Amit Srivastava

Former Member
0 Kudos

Hi srivastava,

yes i am getting the output also same error

Regards

bhaskar

Former Member
0 Kudos

Hi amit.srivastava8,

i wrote the udf-getCostCategory.

i am getting error at udf level and output also NULL POINTER EXCEPTION.

Please gime solution for that.

Thanks & Regards

Bhaskar

Former Member
0 Kudos

Hi,

Ur UDF is the culprit so you have to see why it is failing?

Check if u r passing any input to that UDF (copy source payload for which error is coming and then chk the same under mesage mapping) and also what values it expects to behave correctly...so basically a small debugging is required.

Thanks

Amit Srivastava

Former Member
0 Kudos

paste ur UDF code here

Former Member
0 Kudos

You have an error in a UDF. Take a Java environment and debug the program (if you can't find it looking at the code). This is basic knowledge.

Regards,

Jörg