History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QUARTZ-536
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: James House
Reporter: Eduardo Issao Ito
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Quartz Scheduler

Initialization resource files are opened but never closed

Created: 24/Nov/06 08:53 AM   Updated: 06/Sep/07 05:19 AM
Component/s: Core
Affects Version/s: 1.6
Fix Version/s: 1.6.1

File Attachments: 1. Text File QUARTZ-536.patch (6 kb)

Environment: Windows XP SP2, JDK 1.5.0_09, Sun Application Server 9
Issue Links:
Duplicate
 
This issue is duplicated by:
QUARTZ-612 InputStream's are not being closed af... Minor Closed


 Description  « Hide
When Quartz reads configuration files they are opened but never closed. I detected it in QuartzScheduler and StdSchedulerFactory at least.

When running with Sun Application Server 9, it complains about this when the application is being undeployed:

[#|2006-11-24T12:37:47.015-0300|WARNING|sun-appserver-pe9.0|javax.enterprise.system.core.classloading|_ThreadID=28;_ThreadName=Thread-108;_RequestID=4c85f763-b3c1-4c6a-a452-ba1f14520e74;|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:1123)
at com.sun.enterprise.loader.EJBClassLoader$InternalJarURLConnection.getInputStream(EJBClassLoader.java:1216)
at java.net.URL.openStream(URL.java:1007)
at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1161)
at com.sun.enterprise.loader.EJBClassLoader.getResourceAsStream(EJBClassLoader.java:782)
at java.lang.Class.getResourceAsStream(Class.java:1998)
at org.quartz.core.QuartzScheduler.<clinit>(QuartzScheduler.java:97)
at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1166)
at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1355)


 All   Comments   Change History      Sort Order:
Jasper Rosenberg - [10/Mar/07 06:37 AM ]
InputStream should be closed in a finally block as StdScheduleFactory.initialize() can throw exceptions after the stream has been openned.

Henri Yandell - [29/Mar/07 02:10 PM ]
Attaching a patch that fixes this via a try-finally.

Henri Yandell - [30/Mar/07 12:27 PM ]
svn ci -m "Moving the inputstream close() call into a finally {} block. Also changing an inline FileInputStream so it is held in a variable and can be closed. Requested in QUARTZ-536" src/
Sending src/java/org/quartz/impl/StdSchedulerFactory.java
Transmitting file data .
Committed revision 681.

(trunk: r682)