Namely, upon serialization in the web server I want to set to null the processDefinition field of all instances of the org.jbpm.graph.def.ProcessDefinition class, so I avoid getting this exception whenever returning values from a CXF web service
com.sun.istack.SAXException2 : A cycle is detected in the object graph. This will cause infinitely deep XML: ProcessDefinition(DailyProcess) -> ProcessDefinition(DailyProcess)
The reason for asking is that I already wrote the class below
public class XmlJbpmProcessDefinitionAdapter extends XmlAdapter<ProcessDefinition, ProcessDefinition> {
@Override
public ProcessDefinition unmarshal(ProcessDefinition v) throws Exception {
return v;
}
@Override
public ProcessDefinition marshal(ProcessDefinition v) throws Exception {
v.setProcessDefinition(null);
return v;
}
}
defined it in the package-info.java file as
@XmlJavaTypeAdapter(value=XmlJbpmProcessDefinitionAdapter.class, type=org.jbpm.graph.def.ProcessDefinition.class)
yet its methods are never invoked.