Bug 996274 - Cron scheduling expressions give red bar
Summary: Cron scheduling expressions give red bar
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: Operations
Version: 4.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-12 20:07 UTC by Heiko W. Rupp
Modified: 2022-03-31 04:28 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Heiko W. Rupp 2013-08-12 20:07:31 UTC
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 07:50:56 UTC
The Exception is thrown here:

org.rhq.enterprise.server.operation.OperationManagerBean#convertToTrigger

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

org.rhq.enterprise.gui.coregui.server.gwt.OperationGWTServiceImpl#getResourceOperationSchedule

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 09:29:58 UTC
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.