Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-6262

org.apache.camel.support.ServiceSupport: InputStream not being explicitly closed

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.11.0
    • Fix Version/s: 2.9.7, 2.10.5, 2.11.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Novice

      Description

      In method getVersion() of ServiceSupport there is an InputStream opened around line 284:

      InputStream is = getClass().getResourceAsStream("/META-INF/maven/org.apache.camel/camel-core/pom.properties");

      This stream is not closed explicitly.

      If you undeploy an application from a container like GlassFish you get a warning like this:

      [#|2013-04-11T18:02:00.783+0200|WARNING|glassfish3.1.2|javax.enterprise.system.core.classloading.com.sun.enterprise.loader|_ThreadID=137;_ThreadName=Thread-2;|Input stream has been finalized or forced closed w
      ithout 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.URLClassLoader.getResourceAsStream(URLClassLoader.java:233)
      at com.sun.enterprise.loader.ASURLClassLoader.getResourceAsStream(ASURLClassLoader.java:872)
      at java.lang.Class.getResourceAsStream(Class.java:2049)
      at org.apache.camel.support.ServiceSupport.getVersion(ServiceSupport.java:284)
      at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1439)
      at org.apache.camel.cdi.CdiCamelContext.start(CdiCamelContext.java:61)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [...]

      These were similar issues: XBEAN-190, JCR-2962

        Attachments

          Activity

            People

            • Assignee:
              njiang Willem Jiang
              Reporter:
              mdo Manfred Dohmen
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: