Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

File Modification Times on FTP Adapter

hsr_quantumAug 10 2006 — edited Sep 2 2008
The problem: I have files on an FTP server. The file names have the form <timestamp>XLCLAIM_REQUEST.xml, e.g. 20060802174345_XL_CLAIM_REQUEST.xml. I want to only get files that are at least 5 minutes old to avoid picking up ones that are still being written, so I am using the file modification time parameters on the adapter.

I have gotten parsing the timestamp out of the filename to work, but this has issues given that the timestamps may not represent exactly when the file is uploaded. What I haven't been able to get is parsing the timestamp either out of a directory listing or a file timestamp.

Here are the basics things I have tried:

1) FTP server is running GMT (which is 6 hours ahead of our local time). To accomodate this, I have set the following property in the bpel.xml:

<property name="timestampOffset">21600000</property>

Note that I have also tried setting the above value (=60*60*6*1000) to the negative, in case the offset = LocalServerTime-FTPServerTime, but this didn't change the problems observed in reading modification times.

2) Running ls -l on the FTP server yields the following string:

-rw-r----- 1 3125 3125 8597 Aug 03 04:27 20060802174345_XL_CLAIM_REQUEST.xml

I counted the exact positions of the beginning and end of the timestamp in the listing, and they are indices 43 and 55. (Note that the spaces are compressed out of the text that you see above.) To accomodate this in the adapter .wsdl file, I set the following:

FileModificationTime="DirListing"
ModificationTimeFormat="43,55,MMM dd HH:mm"


When I run the adapter with these settings, I get the following error messages:
<2006-08-03 00:55:38,011> <WARN> <default.collaxa.cube.activation> <FTP Adapter::Inbound> could not parse time: 'null' due to java.lang.NullPointerException
<2006-08-03 00:55:38,027> <DEBUG> <default.collaxa.cube.activation> <FTP Adapter::Inbound> File Modification time : -1
<2006-08-03 00:55:38,027> <ERROR> <default.collaxa.cube.activation> <FTP Adapter::Inbound> Could not get file modification time for : 20060802174345_XL_CLAIM_REQUEST.xml
<2006-08-03 00:55:38,027> <DEBUG> <default.collaxa.cube.activation> <FTP Adapter::Inbound> Error retrieving polled files.
<2006-08-03 00:55:38,027> <DEBUG> <default.collaxa.cube.activation> <FTP Adapter::Inbound>
ORABPEL-11400
Failed to get file modification time.
Could not get file modification time for file :/Dev/\20060802174345_XL_CLAIM_REQUEST.xml. Verify that the values for the "ModificationTimeFormat" activation parameter are correct.Ensure the time format pattern and filename begin index and end index are specified according to the specific FTP server.
Check the error stack and fix the cause of the error. Contact oracle support if error is not fixable.

at oracle.tip.adapter.ftp.inbound.FTPSource.getTimestamp(FTPSource.java:518)
at oracle.tip.adapter.file.inbound.FileList.isMinimumAgePeriod(FileList.java:442)
at oracle.tip.adapter.file.inbound.FileList.ignoreFile(FileList.java:474)
at oracle.tip.adapter.ftp.FTPClient.listFiles(FTPClient.java:636)
at oracle.tip.adapter.ftp.FTPAgent.getFileList(FTPAgent.java:272)
at oracle.tip.adapter.file.inbound.FileSource.getFileList(FileSource.java:199)
at oracle.tip.adapter.file.inbound.PollWork.pollFiles(PollWork.java:217)
at oracle.tip.adapter.file.inbound.PollWork.run(PollWork.java:118)
at oracle.tip.adapter.fw.jca.work.WorkerJob.go(WorkerJob.java:51)
at oracle.tip.adapter.fw.common.ThreadPool.run(ThreadPool.java:267)
at java.lang.Thread.run(Thread.java:534)


3) Running "quote mdtm 20060802174345_XL_CLAIM_REQUEST.xml" on the FTP server yields the following:

213 20060803042709

To accomodate this in the adapter .wsdl file, I set the following:

FileModificationTime="FileSystem"
ModificationTimeFormat="4,18,yyyyMMddHHmmss"


Note that the above is exactly as is specified in the adapter manual and in the examples you sent me. When I run the adapter with these settings, I get the following error messages:

<2006-08-02 23:51:40,629> <WARN> <default.collaxa.cube.activation> <FTP Adapter::Inbound> FTPClient.getMDTM(): unexpected 550 is encountered.
<2006-08-02 23:51:40,629> <ERROR> <default.collaxa.cube.activation> <FTP Adapter::Inbound> Could not get file modification time for : 20060802174345_XL_CLAIM_REQUEST.xml
<2006-08-02 23:51:40,629> <DEBUG> <default.collaxa.cube.activation> <FTP Adapter::Inbound> Error retrieving polled files.
<2006-08-02 23:51:40,629> <DEBUG> <default.collaxa.cube.activation> <FTP Adapter::Inbound>
ORABPEL-11400
Failed to get file modification time.
Could not get file modification time for file :/Dev/\20060802174345_XL_CLAIM_REQUEST.xml. Verify that the values for the "ModificationTimeFormat" activation parameter are correct.Ensure the time format pattern and filename begin index and end index are specified according to the specific FTP server.
Check the error stack and fix the cause of the error. Contact oracle support if error is not fixable.

at oracle.tip.adapter.ftp.inbound.FTPSource.getTimestamp(FTPSource.java:518)
at oracle.tip.adapter.file.inbound.FileList.isMinimumAgePeriod(FileList.java:442)
at oracle.tip.adapter.file.inbound.FileList.ignoreFile(FileList.java:474)
at oracle.tip.adapter.ftp.FTPClient.listFiles(FTPClient.java:636)
at oracle.tip.adapter.ftp.FTPAgent.getFileList(FTPAgent.java:272)
at oracle.tip.adapter.file.inbound.FileSource.getFileList(FileSource.java:199)
at oracle.tip.adapter.file.inbound.PollWork.pollFiles(PollWork.java:217)
at oracle.tip.adapter.file.inbound.PollWork.run(PollWork.java:118)
at oracle.tip.adapter.fw.jca.work.WorkerJob.go(WorkerJob.java:51)
at oracle.tip.adapter.fw.common.ThreadPool.run(ThreadPool.java:267)
at java.lang.Thread.run(Thread.java:534)


I have tried moving the indices around, and no change in the results. I have checked to see if the characters in the ls -l or quote mdtm commands are tabs, and they seem not to be. I have turned debugging all the way up, but I don't get any more information than what is shown above. So, I am stumped.

Thanks for any ideas.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 30 2008
Added on Aug 10 2006
8 comments
6,403 views