cancel
Showing results for 
Search instead for 
Did you mean: 

DynamicConfiguration: Null pointer?

Former Member
0 Kudos

Hi, I'm using a UDF that creates a connection to our database tables to gather information to parse into a file, and this UDF createFileName, which used to work (we're implementing changes to make our UDF lookups more streamlined into 1 Java class)..

however, now I'm running test data and I keep getting this error, traced to DynamicConfiguration put(..) method.

Code:

DynamicConfiguration conf = (DynamicConfiguration) container

.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

String fileName = "Transaction_"siteName[0]"_"timeStamp[timeStamp.length-1]subSeqNumber.trim()+"00.csv";

conf.put(key, fileName); //traced error here

result.addValue(siteName[0]);

Error in mapping test:

Runtime exception during processing target field mapping /ns1:MT_Inventory_Tran/InventoryTran/Supplier_Site_ID. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_XI_Inventory_Tran_Cust_Data_to_SUN_Inventory_Tran_ method createFileName

Thanks for any help.

Adam

Accepted Solutions (1)

Accepted Solutions (1)

henrique_pinto
Active Contributor
0 Kudos

You can't test DynamicConfiguration scenarios in message mapping test tab, since the container() object doesn't exist there (hence the NullPointerException).

Instead of testing the mapping in message mapping test tab, use Interface Mapping test tab.

Regards,

Henrique.

Former Member
0 Kudos

Really? I guess that makes sense.. I'm trying to get the IM tested now and let you know if it's solved, thanks...

sridharreddy_kondam
Active Contributor
0 Kudos

Hi Adam,

I think the field Supplier_Site_ID should pick some value..

R you using any Database lookup for this value ... then check whether the value which you r supplying has Values in the database....

Regards,

sridhar

Former Member
0 Kudos

I am doing these steps. Henrique is right about the IM testing, and the other issues I had we resolved. Thanks all!

Answers (2)

Answers (2)

moorthy
Active Contributor
0 Kudos

Hi,

Check out the data you are getting and accessing those are valid...? Because this may be because you are accessing some parameters for which you are not getting values.

e.g the error is here I think: <i>Transaction_"siteName[0]"_"timeStamp[timeStamp.length-1]subSeqNumber.trim()+"00.csv</i>

TO debug more, use Display Queue option in the mapping editor so that you can see how the data is mapped..

http://help.sap.com/saphelp_nw70/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm

Rgds,

Moorthy

Former Member
0 Kudos

Also, key and fileName are returning proper values, so they aren't showing problems, it happens when I call the put(..) or get() methods of DynamicConfiguration.