Uploaded image for project: 'JBoss ESB'
  1. JBoss ESB
  2. JBESB-3879

Handle a failed file rename better in FileUtils.move

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.11
    • Fix Version/s: 4.13
    • Component/s: Adapters
    • Labels:
      None

      Description

      when a file that is locked by another process is picked up by the SOA platform, and the rename fails, we get a error logg eventhough the file is processed successfully on the next attempt (when the lock is gone).


      2012-05-31 08:43:56,694 DEBUG [org.jboss.soa.esb.util.FileUtil] (ESBScheduler:AnalytixImport.esb_Worker-0) Unable to perform local rename of file 'c:\ipl\itg_kemlabsvar\inbox\D5V843AV.xml' to 'c:\ipl\itg_kemlabsvar\inbox\9f5d7a61-a564-483a-bea6-054331c640d0.D5V843AV.xml.9f5d7a61-a564-483a-bea6-054331c640d0'. Unable to move file.
      2012-05-31 08:43:56,695 ERROR [org.jboss.soa.esb.listeners.gateway.AbstractFileGateway] (ESBScheduler:AnalytixImport.esb_Worker-0) Composer <org.jboss.soa.esb.listeners.gateway.LocalFileMessageComposer> Failed.
      org.jboss.soa.esb.listeners.message.MessageDeliverException: Invalid File payload. File 'c:\ipl\itg_kemlabsvar\inbox\D5V843AV.xml.lck' doesn't exist.


      The call chain here seems to be
      1) AbstractFileGateway.onSchedule()
      2) AbstractFileGateway.setFileWorking(fileIn);
      3) FileGatewayListener.renameFile(from,to);
      4) FileUtil.renameTo(from, to)

      The problem is that FileUtil.renameTo(..) returns true even if it fails to rename the file (in the step where it renames a localfile to a filename that includes the UUID).
      This in turn makes setFileWorking(..) return a non-null value and AbstractFileGateway will go ahead and try to process the non-existing file.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  tcunning Thomas Cunningham
                  Reporter:
                  tcunning Thomas Cunningham
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated: