CaptureAgentStateServiceImplTest incorrectly passes a non-long recording id, misses finding the NullPointer in Impl

Steps to reproduce

1. Create a scheduled event for a capture agent (tested with Galicaster 2.x)

2. Capture agent transitions to recording

3. Error is logged on admin node


Stephen Marquard
September 14, 2016, 7:00 PM

From a brief test on a 2.2.x system, the Admin UI does seem to be showing the correct state of events while they are recording, i.e. if you schedule an event, the CA starts recording, and you filter on Status: Recording in the Admin UI, you get the event currently recording. If the CA isn't online and never started recording, the event doesn't show as recording.

Stephen Marquard
January 9, 2017, 12:38 PM

Here's the stack trace you get from this, when a CA transitions from idle to recording (capturing) for a scheduled recording:

2017-01-09 14:12:53,104 | WARN | (LogUtils:365) - Application {}CaptureAgentStateRestService has thrown exception, unwinding now
at org.apache.cxf.service.invoker.AbstractInvoker.createFault([120:org.apache.cxf.bundle-jaxrs:2.2.9]
at org.apache.cxf.service.invoker.AbstractInvoker.invoke([120:org.apache.cxf.bundle-jaxrs:2.2.9]

(omitted for brevity)

Caused by: java.lang.NullPointerException
at org.opencastproject.capture.admin.impl.CaptureAgentStateServiceImpl.updateWorkflow(
at org.opencastproject.capture.admin.impl.CaptureAgentStateServiceImpl.setRecordingState(
at org.opencastproject.capture.admin.endpoint.CaptureAgentStateRestService.setRecordingState(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_92]
at sun.reflect.NativeMethodAccessorImpl.invoke([:1.8.0_92]
at sun.reflect.DelegatingMethodAccessorImpl.invoke([:1.8.0_92]
at java.lang.reflect.Method.invoke([:1.8.0_92]
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation([120:org.apache.cxf.bundle-jaxrs:2.2.9]
at org.apache.cxf.service.invoker.AbstractInvoker.invoke([120:org.apache.cxf.bundle-jaxrs:2.2.9]
... 91 more

Stephen Marquard
January 9, 2017, 1:12 PM

Adding back Description from Karen which got lost when I changed the issue type to a Bug:

1. The CaptureAgentStateServiceImplTest passes non-long recording ids in it's JUNITS, "Recording1", and misses the now missing workflow Service in line #649 of the impl "workflowService.getWorkflowById(Long.parseLong(recordingId));"
Change the "Recording1" to "101" in the JUNIT to catch the NullPointer.

2. The capture admin service formerly (v1.x) updated the workflow state of the scheduled recording. But in OC 2.2x the workflow service is not available for scheduled recordings, so I don't know what the capture admin service is supposed to now update, the messaging service? The logic of sending status needs to be re-addressed by the Capture API team

3. The workflow service references need to be fully removed from the capture admin code if it cannot update workflows for scheduled recordings.

Fixed and reviewed


Stephen Marquard


Former user


Incorrectly Functioning With Workaround

Tags (folksonomy)


Fix versions

Affects versions