cancel
Showing results for 
Search instead for 
Did you mean: 

About MAPPING_TRACE

Former Member
0 Kudos

Hi experts:

I am trying to use MAPPING_TRACE in my java mapping. My code as below.

private Map param = null;

private AbstractTrace trace = null;

public void setParameter(Map param) {

this.param = param;

}

public void execute(InputStream in, OutputStream out)

throws StreamTransformationException {

trace = (AbstractTrace) param

.get(StreamTransformationConstants.MAPPING_TRACE);

}

But it seems that method setParameter never called when java mapping executed, so the attribute param is always null. As a result, java.lang.NullPointerException was thrown. I have configured the TRACE_LEVEL correct on integration engine, also have searched a lot of SDN posts, but still now work now. Is there any additional configuration needed for operation mapping in ESR?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

setParameter(Map param){} is called after the default constructor and before the exceute() method of java mapping.

private Map param = null;

private AbstractTrace trace = null;

public void setParameter(Map param) {

this.param = param;

}

public void execute(InputStream in, OutputStream out)

throws StreamTransformationException {

trace = (AbstractTrace) param

.get(StreamTransformationConstants.MAPPING_TRACE);

}

Here, param is Map object and by using the get method we are calling the MAPPING_TRACE variable which is in StreamTransformationConstants class to access the values like message header.

Might be u are getting some null values from the message..

0 Kudos

Hi,

To remove Null pointer exception. use the code as below:

public void setParameter(Map param)

{

this.param = param;

if (param == null)

{

this.param = new HashMap();

}

}

Regards,

Neeraj