Thursday, December 24, 2015

File/FTP adapter is not able to pick file from a location


While working in an upgrade project i got this issue.

The process was working fine in 10g but when we upgraded it to 12c via 11g, it wasn't polling from the location.

If you are facing this issue then you can look in to the following details

1> Location where the file/ftp adapter is polling has the permission to read/write file.
2> File placed in the polling location has correct naming convention.
3> File placed has input file which can be validated against schema defined in the BPEL process.


This was more of a lesson learned, I did all these steps but still was not able to read the file from the location.

Now when you upgrade your code from a lower version it does add some additional parameter to your file naming convention.

In my case the process was looking for any file with following naming convention

edi*.txt

So in the JCA file it should ideally be updated as edi.*\.txt

However if you migrate this code it adds additional parameters to this naming convention in JCA file.

So post migration the naming convention got change to edi.*\\.*.txt

Even though it gets changed to the incorrect format, Ideally changing it in run time should enable the process to read file

YOu can go to the process in em console

Select the file read adapter and go to adapter properties to change the value of jca in run time



But to my surprise even after changing the value in em console this was not picking the data.

This is because of a know bug in 12c.

Once you change the jca values at run time you should restart your service from em console.

You can select the process --> Shut it down and then Restart.

Once i did followed the steps my process was able to pick the file from the location.

You still might face issue even after doing all these steps in case of a logical directory.

This is because when a process with logical directory is migrated to 12c the logical path name is moved out of binding in composite.xml

So in order to make sure your logical path gets changed from em console , ensure that your logical name is defined within the binding.jca

<Service>
<interface.wsdl/>
<bindind.jca>
<property name="InputDirectory">/home/Oracle/Poll</property>
</bindind.jca>
</Service>

If you follow all these steps you should be able to poll file

Archieve file in File/FTP adapter


In a normal File/FTP adapter we do not specify the naming convention for File.

In SOA 10g by default it used to append timestamp in the existing file name before writing it to the archieve file.

However in case of 11g or 12c this is totally different.

10g -filename_yyyymmdd_hh24mmss

11g/12c -filename_encryptedToken_yyyymmdd_hh24mmss

If you are working in a migration project this might be a big issue and you will have to fight big time to resolve this issue.

This issue can be resolve by using following propery




By default UseDigest is set to true which leads to the encrypted token being appended in the filename and timestamp as filename_digest_timestamp.
Setting this property to false will change the format to filename_timetamp.

11g

Edit the .jca file to include this property as given below.

<property name="UseDigest" value="false"/>



In 12c

Open the composite.xml

go to the file adapter

and define the property within the jca-binding tab

<jca-binding>
<property name="UseDigest" value="false"/>
</jca-binding>