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

View: New views
5 Messages — Rating Filter:   Alert me  

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

by My Faces - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


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.


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

by My Faces - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Adam Winer commented on TRINIDAD-73:
------------------------------------

It appears that URLConnection.getLastModified() is the culprit - when pointing at a jar: or file: URL, it opens an input stream but does not close it.  getInputStream().close() works around this limitation of URLConnection.

> 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
>
> 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.


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

by My Faces - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/TRINIDAD-73?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adam Winer resolved TRINIDAD-73.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0.2-core

Fixed.   Or, at least, fixed the failures to call close(), and verified that FileInputStream.finalize() now is only running with FileDescriptors whose "handle" is -1, indicating that they've been properly closed.

> 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.


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

by My Faces - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ 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@.../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.


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

by My Faces - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

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

... sorry, I forgot the exception try-catch thing.

> 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.