Bug 996274 - Cron scheduling expressions give red bar
Cron scheduling expressions give red bar
Status: NEW
Product: RHQ Project
Classification: Other
Component: Operations (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
Depends On:
  Show dependency treegraph
Reported: 2013-08-12 16:07 EDT by Heiko W. Rupp
Modified: 2013-08-15 05:29 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Heiko W. Rupp 2013-08-12 16:07:31 EDT
Schedule an operation via cron expression.

- use an invalid expression
- use the example of " 0/5 14,18,3-39,52 * ? JAN,MAR,SEP MON-FRI 2002-2010 "

both will end up in a red bar

Server log shows

- invalid expression
- based on that data the job will never schedule ( " Caused by: org.quartz.SchedulerException: Based on configured schedule, the given trigger will never fire. " )

We need to make sure the user gets the real cause in the bar as a yellow warning
Comment 1 Heiko W. Rupp 2013-08-15 03:50:56 EDT
The Exception is thrown here:


private Trigger convertToTrigger(JobTrigger jobTrigger) throws ParseException {
  Trigger trigger;
  if (jobTrigger.getRecurrenceType() == JobTrigger.RecurrenceType.CRON_EXPRESSION) {
    CronTrigger cronTrigger = new CronTrigger();
    try {
        cronTrigger.setCronExpression(jobTrigger.getCronExpression());  <<<- 1
    } catch (ParseException e) {
        throw new RuntimeException(e);  <<<-- 2
    trigger = cronTrigger;

And then rethrown as RuntimeException which then gets delivered to the red bar as


via org.rhq.enterprise.gui.coregui.server.gwt.AbstractGWTServiceImpl#getExceptionToThrowToClient

I think we should somehow either pass the ParseException around, which has the disadvantage that it needs to be handled in a few more places, that even don't use cron-expressions at all.
Or in org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.schedule.ResourceOperationScheduleDataSource#executeAdd try to find that parse Exception in #onFailure() and display it accordingly.
Comment 2 Heiko W. Rupp 2013-08-15 05:29:58 EDT
Note, that you can already get the parse-exception by right-clicking on the red bar and then on "caused by"

Note You need to log in before you can comment on or make changes to this bug.