Incident service returns internal server error if cascade=true requested for deleted workflow

Steps to reproduce

Steps to reproduce:

1. Request incidents for a deleted workflow, e.g.


You get a 200 OK response and an empty incidentTree, e.g.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><incidentTree xmlns=""/>

2. Request the same but with cascade=true

You get an error 500 internal server error http response.

2015-01-23 09:30:53 ERROR [1212872757@qtp-371877246-9937] (AbstractIncidentService:135) - Error loading child jobs of 40547335: {}
2015-01-23 09:30:53 WARN [1212872757@qtp-371877246-9937] (IncidentServiceEndpoint:227) - Unable to get job incident for id 40547335: org.opencastproject.util.NotFoundException: Workflow '40547335' has been deleted


Actual Results:

Internal Server Error

Expected Results:

Case 2 should be handled like Case 1 (i.e. 200 OK empty incidentTree). Or possibly both should behave differently, e.g. return 404 not found.

Internal Server Error should never be returned for a valid request.

Workaround (if any):


Fixed and reviewed




Stephen Marquard


Incorrectly Functioning With Workaround