on 02-01-2010 8:23 AM
Hi ,
I am developing an adapter module for attaching an image file to the payload. But when i am trying to test my adapter module i am getting the following exception:
MP: exception caught with cause java.lang.NullPointerException
I have configured my adapter module with sender file adapter. I just want to test my module. The module tries to establish an ftp connection , pick a file from ftp location then attach the file to the payload and send.
The code for ftp connection and picking the file is working fine , i have tested it by posting the file to another folder location.
But whenver i try to create the msg object via
msg = (Message ) inputModulePayload.getPrincipleData();
The msg object is null, and then this throws null pointer exception in the next line as i am trying to use the msg object.
Does any one has any idea why i am getting this null pointer exception ?
PS: in the sender communication i have added the cumtom adapter module with module key 1 and sap module is with key 0.
apart from tht there is not setting in the module configuration.
AuditAccess audit = null;
MessageKey key = null;
Object obj = null;
Message msg = null;
Payload payload = null;
// / ModuleData mData = sendModuleData();
try {
// initializing the objects to read the data
obj = inputModuleData.getPrincipalData();
msg = (Message) obj;
audit = PublicAPIAccessFactory.getPublicAPIAccess().getAuditAccess();
key = new MessageKey(msg.getMessageId(), msg.getMessageDirection());
Thanks,
Anumeha
Hi Anumeha,
>>in the sender communication i have added the cumtom adapter module with module key 1 and sap module is with key 0.
apart from tht there is not setting in the module configuration.
It should be the other way round.. first custom module (key 0) then sap module (key 1)..
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you add some traces in the audit log and then run and see where exactly the error comes and check .
Is it because you have not defined msg variable as static ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
In order to create audit object i will have to create it using;
audit = PublicAPIAccessFactory.getPublicAPIAccess().getAuditAccess();
key = new MessageKey(msg.getMessageId(), msg.getMessageDirection());
audit.addAuditLogEntry(key, AuditLogStatus.SUCCESS,"GetAttachment: Module called");
but since my message object is not getting created , i cannot successfully write audit messags as well using the above code.
Also we cannot define Message object as static , you will get "Illegal modifier for parameter msg; only final is permitted" error.
Yes im using PI 7.1 and i have used all lates jar files.
com.sap.aii.af.lib.mod.jar: <bin>/ext/com.sap.aii.af.lib/lib
sap.comtcloggingjavaimpl.jar: <bin>/system
com.sap.aii.af.svc_api.jar: <bin>/services/com.sap.aii.af.svc/lib
com.sap.aii.af.cpa.svc_api.jar: <bin>/services/com.sap.aii.af.cpa.svc/lib
com.sap.aii.af.ms.ifc_api.jar: <bin>/interfaces/com.sap.aii.af.ms.ifc/lib
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.