cancel
Showing results for 
Search instead for 
Did you mean: 

Need resolution fo Nullpointer Exception

former_member203627
Participant
0 Kudos

Hi

I am using Dynamic configuration for getting file name

Error:

RuntimeException in Message-Mapping transformation: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._I813_Proxy_2_EModMCS_MM_ method DateStamp$[Test, com.sap.aii.mappingtool.tf3.rt.Context@78237823]

I am using following java code but when I am testing the same in mapping.

// get the dynamic values from the container object

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

// create a key to access the Filename parameter

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

//below you access the file name from header if it was set in the sender file channel

//String filename= conf.get(key);

String fileName = IFRECID; // date stamp is an input field to the UDF

// Here you set the fileName(ur datestamp) in the Header of the message

conf.put(key, fileName);

return fileName;

Please help ! ! !

Edited by: ria sen on Jul 28, 2008 3:18 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ria,

Please note that as far as the code is concerned .There are some errors in it.

String fileName = IFRECID; // date stamp is an input field to the UDF

This should be

String fileName = "IFRECID";

In java when u r declaring the String literals the correct syntax must be used.

Please check the message type attributes in the file adapter whether it is perfectly done or not.

Finally do the End to End testing rather than standalone testing in the Message mapping tab.

Thanks

Arijit

former_member203627
Participant
0 Kudos

Solved

I did end to end and it worked...thanks for your help ! ! !

Answers (2)

Answers (2)

former_member190389
Active Contributor
0 Kudos

Hi

Test this mapping in the Interface mapping test tab and not in the message mapping...

Acknowledge if any error comes/

former_member203627
Participant
0 Kudos

Hi

I am testing the same in test tab...

former_member190389
Active Contributor
0 Kudos

In the UDF what is the cache that you have selected

Make sure it is "Value" and not context

*I am using Dynamic configuration for getting file name

Error:

RuntimeException in Message-Mapping transformation: Exception:http://java.lang.NullPointerException in class com.sap.xi.tf._I813

*

Are you getting or putting filename?

Edited by: Progirl Progirl on Jul 28, 2008 11:46 AM

Former Member
0 Kudos

Hi,

R u "Testing" using "Test Tab" of the Message mapping.

if so below behavoiur is normal. Run u r scenario as per configuration u wud get the output.

Donot test using"Test Tab"

rwd pnts if useful

rgds

srini