cancel
Showing results for 
Search instead for 
Did you mean: 

PI File adapter additional files error

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Please implement note  -1863092 - Additional files archiving fails with NullPointerException

It should solve your issue

Former Member
0 Kudos

We need to implement that note. Thank you.

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Aber,

I think the file name in the additional files option and the file name you are mentioning in the main level in the channel should match except the extension part.

Please refer the below link and can you cross check once again the configuration.

Specifying Additional Files in the Sender File Adapter - Advanced Adapter Engine - SAP Library

Regards

Vishnu

iaki_vila
Active Contributor
0 Kudos

Hi Aber,

First of all i think you are using wrong this option.

You have defined filename as *.xml. You have to set the real name for example: "Example_xyz.xml"

Later with the transformation attach1.namePart  "_xyz.xml"="_attachment1.pdf", the system will search Example_attachment1.pdf as attachment.

Check this example http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/404ee507-3fbc-2e10-00bc-be90ab28d...

Regards.

dipen_pandya
Contributor
0 Kudos

Hi,

What do you have set in Quality of service? Best effort/Exactly once?