on 01-15-2010 7:39 AM
hi,
i have created an adapter module to retrieve the attachment payload. This module is placed after the Seeburger bic module chain. but everytime i execute the module i get null pointer exception.
i have used the following code to retrieve the attachment.
//code for retrieving the attachment
try {
Iterator itr = msg.getAttachmentIterator();
if (itr.hasNext()) {
while (itr.hasNext()) {
Payload attachment = (Payload) itr.next();
byte payLoadContent[] = null;
in_Data = attachment.getInputStream();
in_Data.read(payLoadContent);
attachmentContent = new String(payLoadContent);
break;
}
}
log(amkey, "The attachment " + attachmentContent, null);
} catch (Exception e) {
log(amkey, " Attachment not found ", e);
throw new ModuleException("Unable to retrieve the atachment payload"e"...exit module");
}
Please let me know how to resolve this error and also how can i retrieve the attachemnt payload.
Regards,
Meenakshi
Hi Meenakshi,
Are you using this module in the receiver communication channel? If yes then make sure you have checked the Read Attachments option in the operation mapping.
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
First check if there are any attachements using
int i = msg.countAttachments();
//then try out
Payload p = msg.getAttachment();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Add trace in your module code for debugging purposes.
Please check J2EE logs so that you can trace where exactly the error is coming from....
Regards,
Swetha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
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.