Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename plugin-cfg File Using Files#Move #16495

Closed
volosied opened this issue Apr 6, 2021 · 0 comments · Fixed by #16541
Closed

Rename plugin-cfg File Using Files#Move #16495

volosied opened this issue Apr 6, 2021 · 0 comments · Fixed by #16541
Assignees
Labels
in:Web Components release bug This bug is present in a released version of Open Liberty release:21005 team:Sirius

Comments

@volosied
Copy link
Member

volosied commented Apr 6, 2021

Debug statement (added in #15813 ) identified the following:
[3/11/21, 1:26:36:757 GMT] 0000004e id=00000000 com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator 3 Rename to plugin-cfg.xml failed!

For rtc defect 270671


There are occasional failures on Windows when renaming this file since File.renameTo is platform dependent.

https://docs.oracle.com/javase/8/docs/api/java/io/File.html#renameTo-java.io.File-

Renames the file denoted by this abstract pathname.

Many aspects of the behavior of this method are inherently platform-dependent: The rename operation might not be able to move a file from one filesystem to another, it might not be atomic, and it might not succeed if a file with the destination abstract pathname already exists. The return value should always be checked to make sure that the rename operation was successful.

Note that the Files class defines the move method to move or rename a file in a platform independent manner.

JavaDoc recommends Files#Move is used instead.

When this error occurs, a FFDC with the following stack trace will occur:

Exception = java.io.FileNotFoundException
Source = com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator
probeid = generateXML
Stack Dump = java.io.FileNotFoundException: C:\path\to\server\logs\state\.plugin-cfg.xml (The process cannot access the file because it is being used by another process)
at java.base/java.io.FileOutputStream.open(FileOutputStream.java:292)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:235)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:185)
at com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator.copyFile(PluginGenerator.java:849)
at com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator.generateXML(PluginGenerator.java:799)
at com.ibm.ws.webcontainer.osgi.mbeans.GeneratePluginConfigMBean.generatePluginConfig(GeneratePluginConfigMBean.java:160)
at com.ibm.ws.webcontainer.osgi.mbeans.GeneratePluginConfigMBean.generatePluginConfig(GeneratePluginConfigMBean.java:262)
at com.ibm.ws.webserver.plugin.runtime.listeners.GeneratePluginConfigListener$1.run(GeneratePluginConfigListener.java:281)

@volosied volosied self-assigned this Apr 6, 2021
@pnicolucci pnicolucci added this to General Issues in Web Tier Team via automation Apr 8, 2021
@pnicolucci pnicolucci added the release bug This bug is present in a released version of Open Liberty label Apr 8, 2021
Web Tier Team automation moved this from General Issues to Completed Tasks Apr 12, 2021
@volosied volosied changed the title Attempt Another Rename for Plugin-cfg.xml Rename plugin-cfg File Using Files#Move Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in:Web Components release bug This bug is present in a released version of Open Liberty release:21005 team:Sirius
Projects
Archived in project
Web Tier Team
  
Completed Tasks
3 participants