Skip to Content
0
Former Member
May 16, 2011 at 08:01 AM

Adapter Module error

209 Views

Hi All

I coded a adapter module but get the following error:

Message processing failed. Cause: java.lang.NullPointerException: while trying to invoke the method com.sap.engine.interfaces.messaging.api.Message.getMessageDirection() of an object loaded from local variable 'msg'

I use the adapter module in a receiver file adapter after the standard CallSapAdapter, When I take code from sdn from blog for sample adapter module I still get this error.

This is where the code is being used:

Message msg = null;

MessageKey key = null;

try {

obj = inputModuleData.getPrincipalData();

msg = (Message) obj;

if (msg.getMessageDirection().equals(MessageDirection.OUTBOUND))

key = new MessageKey(msg.getMessageId(), MessageDirection.OUTBOUND);

else

key = new MessageKey(msg.getMessageId(), MessageDirection.INBOUND);

Any ideas why I'm getting this error?