InputStream doesn't get closed
------------------------------

                 Key: JRUBY-5128
                 URL: http://jira.codehaus.org/browse/JRUBY-5128
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.5.3
         Environment: Mac OS 10.6
java  1.6.0_20
Glassfish 3.0.1
            Reporter: Mike Baranczak
            Assignee: Thomas E Enebo
            Priority: Minor


I'm embedding JRuby in an application that runs in Glassfish. At the moment, 
I'm not actually running Ruby scripts, but at application startup I query the 
javax.script API to find out what scripting engines are available. When the 
application is unloaded, I get the error shown below. It looks like JRuby opens 
a stream when it's initialized, but then never closes it, and Glassfish is 
complaining about that.




WARNING: Input stream has been finalized or forced closed without being 
explicitly closed; stream instantiation reported in following stack trace
java.lang.Throwable
        at 
com.sun.enterprise.loader.ASURLClassLoader$SentinelInputStream.<init>(ASURLClassLoader.java:1153)
        at 
com.sun.enterprise.loader.ASURLClassLoader$InternalJarURLConnection.getInputStream(ASURLClassLoader.java:1246)
        at java.net.URL.openStream(URL.java:1010)
        at 
org.jruby.runtime.load.LoadServiceResource.getInputStream(LoadServiceResource.java:78)
        at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:49)
        at 
org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:671)
        at org.jruby.runtime.load.LoadService.smartLoad(LoadService.java:314)
        at org.jruby.runtime.load.LoadService.require(LoadService.java:357)
        at org.jruby.Ruby.initBuiltins(Ruby.java:1495)
        at org.jruby.Ruby.init(Ruby.java:1087)
        at org.jruby.Ruby.newInstance(Ruby.java:177)
        at 
org.jruby.embed.internal.LocalContext.getRuntime(LocalContext.java:70)
        at org.jruby.embed.internal.LocalContext.getVarMap(LocalContext.java:78)
        at 
org.jruby.embed.internal.SingletonLocalContextProvider.getVarMap(SingletonLocalContextProvider.java:71)
        at 
org.jruby.embed.ScriptingContainer.getVarMap(ScriptingContainer.java:961)
        at org.jruby.embed.jsr223.JRubyBindings.<init>(JRubyBindings.java:54)
        at org.jruby.embed.jsr223.JRubyContext.<init>(JRubyContext.java:78)
        at org.jruby.embed.jsr223.JRubyEngine.<init>(JRubyEngine.java:65)
        at 
org.jruby.embed.jsr223.JRubyEngineFactory.getScriptEngine(JRubyEngineFactory.java:173)
        at 
org.jruby.embed.jsr223.JRubyEngineFactory.getLanguageVersion(JRubyEngineFactory.java:103)

[...... snip proprietary code ............]

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at 
com.sun.ejb.containers.BaseContainer.instantiateOptionalEJBLocalBusinessObjectImpl(BaseContainer.java:3801)
        at 
com.sun.ejb.containers.StatelessSessionContainer.initializeHome(StatelessSessionContainer.java:248)
        at 
com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:161)
        at 
org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:207)
[ snip ]


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

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to