Files locked by JVM in pendingMDN folder - OpenAS2 v4.8.2 #528
-
|
Hi, I am reaching out because we are encountering a file-locking issue after upgrading our environment to OpenAS2 v4.8.2. The Issue
Environment
Has anyone else experienced this with version 4.8.2? Are there any new settings or known bugs regarding file handle management in this release? Any suggestions or patches would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 16 comments 13 replies
-
|
Nobody has reported an y issues like this. |
Beta Was this translation helpful? Give feedback.
-
|
One more thing - do the files that are getting stuck have ".object" extension or no extension? |
Beta Was this translation helpful? Give feedback.
-
|
Hi, I am adding an item; this only happens in the event of a transmission error once all retry attempts have been exhausted.
|
Beta Was this translation helpful? Give feedback.
-
|
Does this happen with all files sent or only the ones that end up in the resender module (this particular example is a file that is being resent via the DirectoryResenderModule thread as indicated in the log message prefix)? The code that controls the creation of the pending file as well as the code that does the cleanup do not open a file handle directly on the cleanup files but instead uses the Apache Commons FileUtils commands. Apaches moveFile actuallly uses a copyfile then delete in your case. This is the Apache method: I have searched on this issue more generally and there do seem to be reported issues using Apache Commons FileUtils when the destination is a Windows network drive. Can you confirm that the file actually does exist in the target network file system: |
Beta Was this translation helpful? Give feedback.
-
|
Please can you confirm that the file actually existed on the file system: From my perspective, this log message is the key to what the real problem is: So in fact the file was not moved because it no longer existed. |
Beta Was this translation helpful? Give feedback.
-
|
We have extracted log for file IT10181220152J$3735919002, which is currently located in the pendingMDN directory. You can find the logs attached below. I have two questions: Was the file successfully copied to the destination folder once the MDN was received? |
Beta Was this translation helpful? Give feedback.
-
|
Here the configuration |
Beta Was this translation helpful? Give feedback.
-
|
There seems to be multiple possible issues going on here so lets try to narrow it down. Prep for the test:
Then run these commands:
Please post the output if there are errors. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
In your post 5 days ago the error message is: Note that it is using 2 backslash characters for the destination file system: \tesinas01\eint_stor... In your test you only used 1 backslash: \tesinas01\eint_stor... Per Windows documentation, it is supposed to only be a single "". I assume if you use 2 then it will fail to move the file. Can you confirm that the configuration is correct on your OpenAS2 errordir in config.xml? |
Beta Was this translation helpful? Give feedback.
-
|
Ah ok. I will make an debug version that synchronizes the access to the cleanupFiles method in case this is a thread issue with a race condition associated. |
Beta Was this translation helpful? Give feedback.
-
|
Hi Christopher, do you have an update ? regs |
Beta Was this translation helpful? Give feedback.
-
|
Please try the attached jar which synchrniozes access to the cleanup of files and uses the try-with mechanism to ensure streams are closed. Additionally, please set this attribute in your openas2.properties file if you are using it: Otherwise put it in the |
Beta Was this translation helpful? Give feedback.
-
|
NOTE: You must completely remove the old openas2 server jar from your installation otherwise it will continue to use the old one. |
Beta Was this translation helpful? Give feedback.
-
|
OK thank you i perform some test |
Beta Was this translation helpful? Give feedback.
-
|
Hi Christopher, Were you able to reproduce the issue I reported? I would like to perform a test before deploying to production, as it is currently the only environment where the problem persists. regs |
Beta Was this translation helpful? Give feedback.


In your post 5 days ago the error message is:
2026-05-07 10:16:34.378 [DirectoryResenderModule] ERROR org.openas2.util.AS2Util - Error moving file to \\tesinas01\eint_stor\gruppotesi\datasite\orxt\ds_dati\culina\error_prod\ : Failed to delete original file 'D:\OpenAS2v2\OpenAS2\.\config\..\data\pendingMDN3\07052026094443+0200-4bd484d4-ed52-4bb7-a453-d0dce003aa29@ALDI_UK_A$3735739227' after copy to '\\tesinas01\eint_stor\gruppotesi\datasite\orxt\ds_dati\culina\error_prod\07052026094443+0200-4bd484d4-ed52-4bb7-a453-d0dce003aa29@ALDI_UK_A$3735739227'Note that it is using 2 backslash characters for the destination file system: \tesinas01\eint_stor...
In your test you only used 1 backslash: \…