Forum Stats

  • 3,826,763 Users
  • 2,260,705 Discussions


File Adapter using it to copy issue

User_3YQO6 Member Posts: 21 Red Ribbon


My requirement is to copy a bunch of files where I have four parameters source dir, source file, target dir and target file. The info for all the four reside in a database table so what I have is a simple BPEL process which reads the database table and then does a file adapter using sync read and then I've modified my file adapter JCA as below :

<!--Generated by Oracle SOA Modeler version at [8/27/21 12:09 PM].-->

<adapter-config name="CopyFile" adapter="file" wsdlLocation="../WSDLs/CopyFile.wsdl" xmlns="">

 <connection-factory location="eis/FileAdapter"/>

 <endpoint-interaction portType="SynchRead_ptt" operation="SynchRead">

  <interaction-spec className="oracle.tip.adapter.file.outbound.FileIoInteractionSpec">

   <property name="SourcePhysicalDirectory" value="/localdir"/>

   <property name="SourceFileName" value="IMGB.JPG"/>

   <property name="TargetPhysicalDirectory" value="TargetDirectory"/>

   <property name="TargetFileName" value="TargetFileName.txt"/>

   <property name="Type" value="COPY"/>




I am passing the values at runtime in the invoke as below :

 <invoke name="InvokeFileCopy" partnerLink="CopyFile" portType="ns2:SynchRead_ptt"

        operation="SynchRead" inputVariable="InvokeFileCopy_SynchRead_InputVariable"

        outputVariable="InvokeFileCopy_SynchRead_OutputVariable" bpelx:invokeAsDetail="no">


     <bpelx:toProperty name="jca.file.SourceDirectory"

             variable="InvokeDB_ReadImagesSelect_OutputVariable" part="FileInfoCollection">



     <bpelx:toProperty name="jca.file.SourceFileName"

             variable="InvokeDB_ReadImagesSelect_OutputVariable" part="FileInfoCollection">



     <bpelx:toProperty name="jca.file.TargetDirectory"

             variable="InvokeDB_ReadImagesSelect_OutputVariable" part="FileInfoCollection">



     <bpelx:toProperty name="jca.file.TargetFileName"

             variable="InvokeDB_ReadImagesSelect_OutputVariable" part="FileInfoCollection">




I am using Transform activity to pass the values to the output variable. This all works great and the copy is successful if I have only one record in the database. But if I have multiple records in the database the invoke throws an error :

Exception occurred when binding was invoked.
Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation 'SynchRead' failed due to: Unable to copy file from source to target.
Unable to copy file from source to target.
Unable to copy  "[email protected]/[email protected]"  to "[email protected]/[email protected]"
Check the error stack and fix the cause of the error.
The invoked JCA adapter raised a resource exception.

That's because the values are not coming in correctly in the invoke anymore. How can I ensure I am able to process more than one row in the file copy ?

Thank you.