BeansXmlParser doesn't close beans.xml file InputStream
-------------------------------------------------------
Key: WELD-773
URL:
https://jira.jboss.org/browse/WELD-773
Project: Weld
Issue Type: Bug
Components: Resolution (Typesafe and by Name)
Affects Versions: 1.1.0.Beta2
Reporter: Sivakumar Thyagarajan
Priority: Minor
The stream opened for parsing beans.xml is not closed expliciltly in a finally block in
BeansXmlParser.java
Here is the relevant trace:
at java.net.URL.openStream(URL.java:1010)
at org.jboss.weld.xml.BeansXmlParser.parse(BeansXmlParser.java:80)
at org.jboss.weld.xml.BeansXmlParser.parse(BeansXmlParser.java:122)
at org.jboss.weld.bootstrap.WeldBootstrap.parse(WeldBootstrap.java:509)
at
org.glassfish.weld.BeanDeploymentArchiveImpl.getBeansXml(BeanDeploymentArchiveImpl.java:180)
at org.jboss.weld.bootstrap.BeanDeployment.<init>(BeanDeployment.java:103)
at
org.jboss.weld.bootstrap.WeldBootstrap$DeploymentVisitor.visit(WeldBootstrap.java:184)
at
org.jboss.weld.bootstrap.WeldBootstrap$DeploymentVisitor.visit(WeldBootstrap.java:155)
at org.jboss.weld.bootstrap.WeldBootstrap.startContainer(WeldBootstrap.java:286)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:161)
GlassFish throws a WARNING in the server log when such scenarios happens (ie a stream is
left unclosed after use, and the application classloader goes out of scope or is
finalized) [1]. So it would be nice if we could fix this in Weld 1.1.
[1]
[#|2010-12-02T22:36:25.313+0530|WARNING|glassfish3.1|javax.enterprise.system.core.classloading.com.sun.enterprise.loader|_ThreadID=132;_ThreadName=admin-thread-pool-4848(5);|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.jboss.weld.xml.BeansXmlParser.parse(BeansXmlParser.java:80)
at org.jboss.weld.xml.BeansXmlParser.parse(BeansXmlParser.java:122)
at org.jboss.weld.bootstrap.WeldBootstrap.parse(WeldBootstrap.java:509)
at
org.glassfish.weld.BeanDeploymentArchiveImpl.getBeansXml(BeanDeploymentArchiveImpl.java:180)
at org.jboss.weld.bootstrap.BeanDeployment.<init>(BeanDeployment.java:103)
at
org.jboss.weld.bootstrap.WeldBootstrap$DeploymentVisitor.visit(WeldBootstrap.java:184)
at
org.jboss.weld.bootstrap.WeldBootstrap$DeploymentVisitor.visit(WeldBootstrap.java:155)
at org.jboss.weld.bootstrap.WeldBootstrap.startContainer(WeldBootstrap.java:286)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:161)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:128)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:266)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:369)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:354)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:369)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1079)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1257)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1246)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:449)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:216)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:234)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:817)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:718)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1007)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
|#]
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira