Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

java function with Dynamic config throws null pointer exception

hi Experts,

I am using dynamic config using java function in my message mapping.

The source message has a field called "fname".

The value of "fname" is the input to my java UDF.

The java UDF code is:

public String getDynamicFile(String fname, Container container) throws StreamTransformationException{

String str = fname + ".xml";

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

DynamicConfigurationKey FileName = DynamicConfigurationKey.create("http:/"+"/","FileName");

conf.put(FileName, str);

return str;


When I test this message mapping I get the following exception:

Runtime Exception:[java.lang.NullPointerException: while trying to invoke the method, java.lang.String) of an object loaded from local variable '<4>'] in class<message mapping>_ method getDynamicFile[test,]

What am I doing wrong in this UDF?



Not what you were looking for? View more on this topic or Ask a question