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

Key: QUARTZ-667
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: James House
Reporter: jake graft
Votes: 0
Watchers: 0
Operations

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

FileScanJob can only access files in WEB-INF/lib ALSO null pointer error in getLastModifiedDate()

Created: 22/May/08 05:59 PM   Updated: 02/Aug/08 09:24 PM
Component/s: Jobs
Affects Version/s: 1.6.1
Fix Version/s: None

Environment: Oracle JDeveloper using OC4J (-userThreads turned on)


 Description  « Hide
1.6.1 RC1

In the getLastModifiedDate() of FileScanJob.java, there is an attempt to load the file via
  URL resource = Thread.currentThread().getContextClassLoader().getResource(fileName);

Issue: The context is limited to files in the threads context, hence only file in /WEB-INF/lib are allowed to be loaded. Not very helpful.

Issue: If the getResource() fails, the URL resource is null, and a subsequent line throws a null pointer exception.

Tried with quartz.properties
        threadsInheritContextClassLoaderOfInitializingThread = false
and threadsInheritContextClassLoaderOfInitializingThread = true
with no difference.

The production 1.6.0 version works (getLastModifiedDate() uses File() in this version)

Try getResource() first, if that returns null, revert to File() as in 1.6.0, If that fails throw a more useful error.

Extra Suggestion: Allow a File object to be passed to the FileScanJob in addtion to the String fileName.


 All   Comments   Change History      Sort Order:
jake graft - [22/May/08 06:19 PM ]
Also note that JobDetails calls a commons collection SetUtils() method while defining a class variable.

    private Set jobListeners = SetUtils.orderedSet(new HashSet());

I would think you would just define it null, and initialize it in a constructor, where you can catch an error (like not having the latest commons-collections). That was 1/2 hour of research.

I agree with removing the dependence on commons.

James House - [02/Aug/08 09:24 PM ]
Added fall back to just creating a file based on the file name.