Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5293

ASTTransformationVisitor not closing URL streams

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-beta-2
    • 2.0-beta-3, 1.8.7
    • Compiler
    • None
    • Windows XP, java 1.6.0_30 , glassfish 3.1

    Description

      I'm using Groovy as a script language in EJB in Glassfish 3.1
      After using GroovyShell, when i'm shutting down the server i'm getting a lot of 'open stream' errors.
      I've tested this bug with Groovy 1.8.5, 1.9 and 2 beta 2 - still the same

      There's a line in ASTTransformationVisitor.java - line 202 in 2.0 beta 2
      BufferedReader svcIn = new BufferedReader(new InputStreamReader(service.openStream()));

      Looks like that stream is never closed ?

      Below stack trace:

      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:1230)
      at com.sun.enterprise.loader.ASURLClassLoader$InternalJarURLConnection.getInputStream(ASURLClassLoader.java:1338)
      at java.net.URL.openStream(URL.java:1010)
      at org.codehaus.groovy.transform.ASTTransformationVisitor.doAddGlobalTransforms(ASTTransformationVisitor.java:202)
      at org.codehaus.groovy.transform.ASTTransformationVisitor.addGlobalTransforms(ASTTransformationVisitor.java:190)
      at org.codehaus.groovy.transform.ASTTransformationVisitor.addPhaseOperations(ASTTransformationVisitor.java:154)
      at org.codehaus.groovy.control.CompilationUnit.<init>(CompilationUnit.java:187)
      at org.codehaus.groovy.control.CompilationUnit.<init>(CompilationUnit.java:118)
      at groovy.lang.GroovyClassLoader.createCompilationUnit(GroovyClassLoader.java:436)
      at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:271)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:264)
      at groovy.lang.GroovyShell.parseClass(GroovyShell.java:638)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:650)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:677)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:668)

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            guillaume Guillaume Sauthier
            piotrek@mente.pl PiotrC
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment