You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Thomas Jacob (JIRA)" <de...@myfaces.apache.org> on 2008/05/08 15:26:55 UTC

[jira] Commented: (TRINIDAD-73) trinidad-impl.jar file is left open during execution

    [ https://issues.apache.org/jira/browse/TRINIDAD-73?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595227#action_12595227 ] 

Thomas Jacob commented on TRINIDAD-73:
--------------------------------------

Sorry, but the fix does not work. The JARUrlConnection to the entry delegates to a UrlConnection to the entire JAR file, which in turn has the problem described above.
The close() in the fix is performed on the wrong connection.
However, the JAR file UrlConnection is not accessable, but changing the code

      URLConnection connection = url.openConnection();
      long modified = connection.getLastModified();
      try
      {
        InputStream is = connection.getInputStream();
        if (is != null)
          is.close();
      }

to

            URLConnection connection = url.openConnection();
            long modified;
            if (connection instanceof JarURLConnection) {
                JarURLConnection jarUrlConnection = (JarURLConnection) connection;
                URL jarFileUrl = jarUrlConnection.getJarFileURL();
                URLConnection jarFileConnection = jarFileUrl.openConnection();
                lastModified = jarFileConnection.getLastModified();
                jarFileConnection.getInputStream().close();
            }
            else {
                lastModified = connection.getLastModified();
            }

may work.

See http://www.mail-archive.com/wicket-user@lists.sourceforge.net/msg20937.html as well.


> trinidad-impl.jar file is left open during execution
> ----------------------------------------------------
>
>                 Key: TRINIDAD-73
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-73
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 1.0.1-core
>            Reporter: Adam Winer
>            Assignee: Adam Winer
>             Fix For: 1.0.2-core
>
>
> When running a Trinidad application, trinidad-impl.jar is getting locked with open FileInputStream objects.  When GC occurs, the FileInputStreams are getting cleared, but as new FileInputStreams are opened on each request, the file is eternally locked.  Other files are likely getting locked too.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.