JDK-6199749 : A need to document in our API that it is necessary for explict exclusion control when using ZipFile
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 1.4.2
  • Priority: P2
  • Status: Closed
  • Resolution: Won't Fix
  • OS: solaris_8
  • CPU: sparc
  • Submitted: 2004-11-24
  • Updated: 2011-05-02
  • Resolved: 2006-02-14
Related Reports
Relates :  
Relates :  
Description
This is related to bug 4369396. 

Questions
===========
Can you ask the customer if the problem can be reproduced everytime ? What is the pattern ? Did the customer modified the war/ear file ( dynamic reloading, deployment etc ) ? 

Answer
======
When the servlet was reloding (weblogic.servlet.internal.ServletStubImpl.checkForReload), the zip class was read, the java process crashes ....


---hs_err_pid.log---
Current Java thread:
    at java.util.zip.ZipFile.getEntry(Native Method)
    at java.util.zip.ZipFile.getEntry(ZipFile.java:146)
    - locked <dd5abaa8> (a weblogic.utils.classloaders.ClasspathClassFinder$Z
ipFileWrapper)      at weblogic.servlet.internal.WarClassFinder.getSource(WarClassFinder.java:236)
    at weblogic.servlet.internal.WebAppServletContext.getSource(WebAppServletContex
t.java:4402)      at weblogic.servlet.internal.WebAppServletContext.getResourceAsSource(WebAppSer
vletContext.java:5986)      at weblogic.servlet.internal.WebAppServletContext.getResourceAsStream(WebAppSer
vletContext.java:996)      at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1429)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:466)
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubI
mpl.java:993)      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec
t.java:317)      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java
:869)      - locked <dd5ca0a0> (a weblogic.servlet.internal.ServletStubImpl)
    at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.ja
va:848)      at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.jav
a:787)      - locked <dd5ca0a0> (a weblogic.servlet.internal.ServletStubImpl)
    at weblogic.servlet.internal.ServletStubImpl.reloadServlet(ServletStubImpl.java
:705)      at weblogic.servlet.internal.ServletStubImpl.checkForReload(ServletStubImpl.jav
a:685)      - locked <dd5ca0a0> (a weblogic.servlet.internal.ServletStubImpl)
---

Comments
EVALUATION It remains the responsibility of client code to understand when & where file locking is required, and where it is not. Adding documentation to ZipFile would only be starting down a slippery slope of adding similar documentation to other Java APIs. E.g., a .zip file could be concurrently accessed via a URLClassLoader while being modified through some other part of the (client) code.
14-02-2006

SUGGESTED FIX To resolve this issue, there is a need to document in our API that it is necessary for explict exclusion control when using ZipFile. ###@###.### 2004-11-24 02:32:07 GMT
24-11-2004

EVALUATION Reassign to Tools and Library team. ###@###.### 2004-11-30 01:55:17 GMT
24-11-2004