I'm calling a java class from BPEL via bpelx:exec. It would simplify things a lot if the class was able to throw a specific Fault (known to BPEL from one of its partner links). Let's call it AdapterFault. AdapterFault is generated by wsimport and subclasses Exception.
Here's the code within Embedded Java block:
Object wfr = getVariableData("inputVariable","request");
Object req = getVariableData("V_CreateServiceRequest","createTNRequestPart");
somepackage.EndpointIterator it =
new somepackage.EndpointIterator();
it.setWFRequest(wfr);
it.setPlatformName("MMSC");
it.setOperationName("createTN");
it.setRequest(req);
Object reply = it.invoke();
setVariableData("V_CreateServiceResponse","createTNResponsePart",reply);
When I declare the java method as throwing the AdapterFault, the BPEL refuses to deploy complaining that Exception is uncaught. It seems that Java callout step only declares BPELFault.
I'm only able to throw RuntimeException, which goes to CatchAll block instead of catch(AdapterFault).
Is there a simple way to throw a checked Fault from a java call-out?