[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4078) Jar locking during of component initialization on Windows

Andrey Lomakin (JIRA) jira-events at lists.jboss.org
Sat Apr 4 05:05:35 EDT 2009


Jar locking during of component initialization on Windows
---------------------------------------------------------

                 Key: JBSEAM-4078
                 URL: https://jira.jboss.org/jira/browse/JBSEAM-4078
             Project: Seam
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.1.1.GA
         Environment: Windows 2000, Java(TM) SE Runtime Environment (build 1.6.0_13-b03), GlassFish v3 Prelude (build b28c)
            Reporter: Andrey Lomakin


JARs that contain components.xml are locked till server shutdown and can not be removed after application undeploy on Windows.
As I understend following snippet of code in method  org.jboss.seam.init.Initialization#initComponentsFromXmlDocuments:

               InputStream stream = url.openStream();

               log.debug("reading " + url);
               try {
                   installComponentsFromXmlElements(XML.getRootElement(stream), replacements);
               } finally {
                   Resources.closeStream(stream);
               }

should be replaced by 
              URLConnection connection = url.openConnection();
              connection.setUseCaches(false);
              InputStream stream = url.openStream();
             // and so on...

If cashes will not be switched of file will be opened but never closed.
Returned instance of InputStream interface is sun.net.www.protocol.jar.JarURLConnection,JarURLInputStream that closes opened jar file
only if cashes are not used.
class JarURLInputStream extends java.io.FilterInputStream {
  103           JarURLInputStream (InputStream src) {
  104               super (src);
  105           }
  106           public void close () throws IOException {
  107               try {
  108                   super.close();
  109               } finally {
  110                   if (!getUseCaches()) {
  111                       jarFile.close();
  112                   }
  113               }
  114           }
  115       }








-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list