APAR status
Closed as program error.
Error description
Error Message: Deleting the jar file, after the Closing the URLClassloader fails, with file in use. Test snippet: URLClassLoader cl = new URLClassLoader(..f.toURI().toURL().); cl.getResource("..."); cl.close(); System.out.println("delete = " + f.delete()); => This fails with file in use . Stack Trace: N/A . N/A
Local fix
Can use one of these workarounds 1. Either Use getResourceasStream() instead of getresource.. 2. Or Close the connection by for (URL u : cl.getURLs()) { if (u.getProtocol().equals("jar")) { ((JarURLConnection)u.openConnection()).getJarFile().close(); } }
Problem summary
Closeables does not handle closing of all the open handles for getresource.
Problem conclusion
This defect will be fixed in: 7.0.0 . Closeables for URLClassloader is updated to handle this scenario.
Temporary fix
Comments
APAR Information
APAR number
IV27404
Reported component name
JAVA CLASS LIBS
Reported component ID
620700130
Reported release
700
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2012-09-03
Closed date
2012-09-17
Last modified date
2012-09-17
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
JAVA CLASS LIBS
Fixed component ID
620700130
Applicable component levels
R700 PSY
UP
[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSNVBF","label":"Runtimes for Java Technology"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.0","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]
Document Information
Modified date:
21 February 2022