[jboss-jira] [JBoss JIRA] Closed: (JBMICROCONT-115) VirtualFile.finalize closing stream causes read errors on in use streams

Scott M Stark (JIRA) jira-events at jboss.com
Tue Dec 5 00:23:55 EST 2006


     [ http://jira.jboss.com/jira/browse/JBMICROCONT-115?page=all ]

Scott M Stark closed JBMICROCONT-115.
-------------------------------------

    Resolution: Done

The finalize method has been removed.

> VirtualFile.finalize closing stream causes read errors on in use streams
> ------------------------------------------------------------------------
>
>                 Key: JBMICROCONT-115
>                 URL: http://jira.jboss.com/jira/browse/JBMICROCONT-115
>             Project: JBoss MicroContainer
>          Issue Type: Bug
>          Components: VFS
>    Affects Versions: JBossMC_2_0_0 Beta
>            Reporter: Scott M Stark
>         Assigned To: Scott M Stark
>             Fix For: JBossMC_2_0_0_CR1
>
>
> In looking into the  JBAS-3867 read error, I found that the VirtualFile finalizer behavior of closing the open streams is causing active streams to fail:
> 06:29:10,515 ERROR [STDERR] java.io.FileInputStream at ba8af9 failed,
> fd=java.io.FileDescriptor at 13c339f[fd=-1,handle=-1,prevHandle=4652], isValid=false,
> java.io.IOException: Read error
> 06:29:10,515 ERROR [STDERR] java.io.FileInputStream at ba8af9, fd=4652
> already closed at:
> 06:29:10,515 ERROR [STDERR] java.lang.Thread.dumpThreads(Native Method)
> 06:29:10,515 ERROR [STDERR] java.lang.Thread.getStackTrace(Thread.java:1383)
> 06:29:10,515 ERROR [STDERR]
> java.io.FileInputStream.close(FileInputStream.java:279)
> 06:29:10,515 ERROR [STDERR]
> org.jboss.virtual.VirtualFile.closeStreams(VirtualFile.java:210)
> 06:29:10,515 ERROR [STDERR]
> org.jboss.virtual.VirtualFile.close(VirtualFile.java:227)
> 06:29:10,515 ERROR [STDERR]
> org.jboss.virtual.VirtualFile.finalize(VirtualFile.java:390)
> 06:29:10,515 ERROR [STDERR]
> java.lang.ref.Finalizer.invokeFinalizeMethod(NativeMethod)
> 06:29:10,515 ERROR [STDERR]
> java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
> 06:29:10,515 ERROR [STDERR]
> java.lang.ref.Finalizer.access$100(Finalizer.java:14)
> 06:29:10,515 ERROR [STDERR]
> java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
> The problem is that one can be using a stream without reference to the VirtualFile. The usage in the web deployer where this occurs is of the form:
> InputStream[] webXmlStreams = getInputStreams()
>    private InputStream[] getInputStreams()
>    {
>       InputStream jbossWebIS = null;
>       InputStream webIS = null;
>       try
>       {
>          VirtualFile webDD = unit.getMetaDataFile("web.xml");
>          if (webDD != null)
>             webIS = webDD.openStream();
>       }
>       catch (IOException e)
>       {
>          log.debug("Failed to find web.xml");
>       }
>       try
>       {
>          VirtualFile webDD = unit.getMetaDataFile("jboss-web.xml");
>          if (webDD != null)
>             jbossWebIS = webDD.openStream();
>       }
>       catch (IOException e)
>       {
>          log.debug("Failed to find jboss-web.xml");
>       }
>       InputStream[] streams = {webIS, jbossWebIS};
>       return streams;
>    }
> so the VirtualFiles associated with the descriptors have no references, but the streams do.

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

        



More information about the jboss-jira mailing list