No matching parent execution for error code found

While throwing a exception from the execute method of service task, I am getting “No matching parent execution for error code found”. Even though I have defined error handling in the xml and follwing error handling service task.

<boundaryEvent id=“boundaryerror1” name=“emailBoundaryError” attachedToRef=“emailsubprocess”>
<errorEventDefinition errorRef=“”></errorEventDefinition>
<sequenceFlow id=“flow76” sourceRef=“boundaryerror1” targetRef=“errorHandlerServiceTask”></sequenceFlow>

Code Snippet:
public void execute( final DelegateExecution execution ) {
try {
//throw exception
} catch ( final Exception e ) {
runtimeService.setVariable( execution.getId(), “errorlogging”, e );
throw new BpmnError( “”, “followup email error detail” );

That should work indeed. Can you paste your full process definition? Did you define the error at the process instance level?