Details
-
Bug
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
2.11.0
-
None
-
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)
[...]