Hello,
I'm using file adapter(sender) to read additional files as attachments. I'm picking one XML file as payload and two PDF documents as attachments. One of that PDF document is optional. I have the optional parameter for the second attachment set as 'YES'. When both the files are available the channel picks them up with no error. But when only one file is available it gives an error saying
"Could not process due to error: java.lang.NullPointerException: while trying to invoke the method com.sap.aii.adapter.file.io.FileHandle.length() of an object loaded from an array (which itself was loaded from field com.sap.aii.adapter.file.File2XI.attachedFiles_ of an object) with an index loaded from local variable 'ii'"
The error is thrown in the channel but the files get picked up and processed as usual.
Can anyone help? Not sure why I'm getting this error though I marked the second attachment as optional.
Category:com.sap.aii.adapter.file.File2XI
Location:com.sap.aii.adapter.file.File2XI.invoke()
Parameters in the channel:
Source dir ***
Filename *.xml
Additional files checked
File list attach1,attach2
attach1.namePart "_xyz.xml"="_attachment1.pdf"
attach2.namePart "_xyz.xml"="_attachment2.pdf"
attach1.optional NO
attach2.optional YES
attach1.type BIN
attach2.type BIN
Please advise.
Thank you.
Larry.