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

Key: QUARTZ-571
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: James House
Reporter: Ann Friauf
Votes: 0
Watchers: 1
Operations

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

CronExpression is not building the expression correctly after being deserialized

Created: 04/Apr/07 01:29 PM   Updated: 18/Apr/07 09:54 AM
Component/s: Triggers
Affects Version/s: 1.6
Fix Version/s: 1.6.1

File Attachments: 1. Text File QUARTZ-571.patch (2 kb)

Environment: Windows XP

Flags: Important


 Description  « Hide
In the CronExpression constructor, CronExpression calls buildExpression with the following line of code:

        buildExpression(cronExpression.toUpperCase(Locale.US));

However, in the readObject method, it has the following line of code:

            buildExpression(cronExpression);

I have a custom trigger with a cron trigger as a delegate. My cron expression looks like this:

19 15 10 4 Apr ?

When I create the cron trigger there is no problem. However, when I try to run the job, I get the following exception after the trigger has fired once:

org.quartz.JobPersistenceException: Unexpected runtime exception: Support for specifying both a day-of-week AND a day-of-month parameter is not implemented. [See nested exception: java.lang.UnsupportedOperationException: Support for specifying both a day-of-week AND a day-of-month parameter is not implemented.]

When the cron trigger is deserialized, the expression is not build correctly.

 All   Comments   Change History      Sort Order:
James House - [04/Apr/07 01:42 PM ]

Interesting bug. Thanks for the report.

Probably the expression should be toUpper'ed once, and stored that way, such that it doesn't matter after serialization, etc.

Ann Friauf - [04/Apr/07 04:36 PM ]
I patched my version of CronExpression as follows:

    public CronExpression(String cronExpression) throws ParseException {
        if (cronExpression == null) {
            throw new IllegalArgumentException("cronExpression cannot be null");
        }
        
        this.cronExpression = cronExpression.toUpperCase(Locale.US);
        
        buildExpression(this.cronExpression);
    }

The readObject method was unchanged.

Henri Yandell - [08/Apr/07 06:28 PM ]
Unit test and fix in a patch.

Henri Yandell - [18/Apr/07 09:53 AM ]
svn ci -m "Fixing QUARTZ-571 - cronExpression case no longer changes in serialization" src/
Sending src/java/org/quartz/CronExpression.java
Sending src/test/java/org/quartz/CronExpressionTest.java
Transmitting file data ..
Committed revision 691.

Henri Yandell - [18/Apr/07 09:54 AM ]
(and on trunk)

 svn ci -m "Fixing QUARTZ-571 - cronExpression case no longer changes in serialization" src/
Sending src/java/org/quartz/CronExpression.java
Sending src/test/java/org/quartz/CronExpressionTest.java
Transmitting file data ..
Committed revision 692.