Details
-
Bug
-
Resolution: Done
-
Major
-
4.0.7
Description
I am using the Drools PackageBuilder to create business rules from a file. While the rules appear to function correctly, when the JVM which runs the application shuts down, an exception is thrown due to the forced closing of an unclosed stream. It looks from the stack trace like the Drools code is opening a stream using ClassLoader.getResourceAsStream which is then left unclosed and is forced close at JVM shutdown.
On application server shutdown, I receive the following exception. This appears to be the result of an unclosed input stream for a system resource used by the Drools compiler.
[#|2008-10-23T09:55:09.527-0600|WARNING|sun-appserver9.1|javax.enterprise.system.core.classloading|_ThreadID=22;_ThreadName=RMI TCP Connection(1197)-10.97.100.58;_RequestID=341c51d9-08de-4e67-9da1-c57375cb5f35;|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.EJBClassLoader$SentinelInputStream.<init>(EJBClassLoader.java:1169)
at com.sun.enterprise.loader.EJBClassLoader$InternalJarURLConnection.getInputStream(EJBClassLoader.java:1262)
at java.net.URL.openStream(URL.java:1009)
at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1161)
at com.sun.enterprise.loader.EJBClassLoader.getResourceAsStream(EJBClassLoader.java:799)
at org.drools.rule.PackageCompilationData$PackageClassLoader.getResourceAsStream(PackageCompilationData.java:384)
at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.isPackage(EclipseJavaCompiler.java:280)
at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:222)
at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:204)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:97)
at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:43)
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveUnresolvedType(BinaryTypeBinding.java:138)
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.superclass(BinaryTypeBinding.java:936)
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.getExactMethod(BinaryTypeBinding.java:724)
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.getExactMethod(BinaryTypeBinding.java:727)
at org.eclipse.jdt.internal.compiler.lookup.Scope.findExactMethod(Scope.java:761)
at org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod(Scope.java:2002)
at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:384)
at org.eclipse.jdt.internal.compiler.ast.ReturnStatement.resolve(ReturnStatement.java:220)
at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:432)
at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:190)
at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:403)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1047)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1094)
at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:353)
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:596)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:411)
at org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:351)
at org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:51)
at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:342)
at org.drools.compiler.DialectRegistry.compileAll(DialectRegistry.java:60)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:308)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167)