ode-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Goldhammer <Goldhammer.J...@gmx.net>
Subject Error handling in bpel processes
Date Tue, 02 Oct 2007 16:33:46 GMT

Hello, 

I know there were discussions about faultHandlers, but I have not found the
solution for my problem.
In my bpel-process I try to invoke several webservices. If a webservices has
an internal error, it throws a defined error back to the bpel process. I
want to handle it by a local fault handler.

The local faulthandler is defined as followed:

<bpws:faultHandlers>
                    <bpws:catch faultMessageType="ns3:dmsFaultException"
                        faultName="ns3:fault" faultVariable="dmsfaultName">
                        <bpws:sequence>
                            <bpws:rethrow name="rethrow dms archive fault"/>
                        </bpws:sequence>
                    </bpws:catch>
                    <bpws:catch faultMessageType="ns1:logFaultException"
                        faultName="ns1:fault" faultVariable="logFault">
                        <bpws:sequence>
                            <bpws:assign name="Assign" validate="no">
                                <bpws:copy>
                                    <bpws:from>
                                    <bpws:literal>
                                    <cisArchiveResponse
xmlns="http://com.ibm.de.cis/archive">
                                    <result/>
                                    </cisArchiveResponse>
                                    </bpws:literal>
                                    </bpws:from>
                                   
<bpws:to><![CDATA[$output.payload]]></bpws:to>
                                </bpws:copy>
                                <bpws:copy>
                                    <bpws:from>
                                    <bpws:literal> catch log Failure
                              </bpws:literal>
                                    </bpws:from>
                                   
<bpws:to><![CDATA[$output.payload/tns:result]]></bpws:to>
                                </bpws:copy>
                            </bpws:assign>
                            <bpws:reply name="EndArchiveProcess"
                                operation="process"
                                partnerLink="cisArchive"
                                portType="ibm:cisArchive"
variable="output"/>
                            <bpws:exit name="Terminate"/>
                        </bpws:sequence>
                    </bpws:catch>
                </bpws:faultHandlers>

Instead of replying with the message catch log Failure, ode invokes nothing
and the process will not be terminated. The instance is still active!
(invoked the instancemanagement-api)

The following stacktrace is provided by ode:

Error sending message (mex={PartnerRoleMex#hqejbhcnphr2muh7icf4ww [PID
{http://com.ibm.de.cis/archive}cisArchive-40] calling
org.apache.ode.bpel.epr.URLEndpoint@165ded3.logRun(...)}): LogFaultException
org.apache.axis2.AxisFault: LogFaultException
	at
org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
	at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
	at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
	at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
	at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
	at org.apache.ode.axis2.ExternalService$1$1.call(ExternalService.java:148)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
	at java.util.concurrent.FutureTask.run(FutureTask.java:123)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
	at java.lang.Thread.run(Thread.java:595)
18:22:28,674 ERROR [ExternalService] Error sending message
(mex={PartnerRoleMex#hqejbhcnphr2muh7icf4ww [PID
{http://com.ibm.de.cis/archive}cisArchive-40] calling
org.apache.ode.bpel.epr.URLEndpoint@165ded3.logRun(...)}): LogFaultException
org.apache.axis2.AxisFault: LogFaultException
	at
org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
	at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
	at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
	at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
	at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
	at org.apache.ode.axis2.ExternalService$1$1.call(ExternalService.java:148)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
	at java.util.concurrent.FutureTask.run(FutureTask.java:123)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
	at java.lang.Thread.run(Thread.java:595)
DEBUG - GeronimoLog.trace(54) | Mex[hqejbhcnphr2muh7icf4ww].setPortOp(...)
18:22:28,844 DEBUG [MessageExchangeImpl]
Mex[hqejbhcnphr2muh7icf4ww].setPortOp(...)
DEBUG - GeronimoLog.debug(66) | replyWithFailure mex=hqejbhcnphr2muh7icf4ww
failureType=COMMUNICATION_ERROR description=Error sending message
(mex={PartnerRoleMex#hqejbhcnphr2muh7icf4ww [PID
{http://com.ibm.de.cis/archive}cisArchive-40] calling
org.apache.ode.bpel.epr.URLEndpoint@165ded3.logRun(...)}): LogFaultException
details=null
18:22:28,844 DEBUG [PartnerRoleMessageExchangeImpl] replyWithFailure
mex=hqejbhcnphr2muh7icf4ww failureType=COMMUNICATION_ERROR description=Error
sending message (mex={PartnerRoleMex#hqejbhcnphr2muh7icf4ww [PID
{http://com.ibm.de.cis/archive}cisArchive-40] calling
org.apache.ode.bpel.epr.URLEndpoint@165ded3.logRun(...)}): LogFaultException
details=null
DEBUG - GeronimoLog.debug(66) | create work event for
mex=hqejbhcnphr2muh7icf4ww
18:22:28,844 DEBUG [PartnerRoleMessageExchangeImpl] create work event for
mex=hqejbhcnphr2muh7icf4ww
DEBUG - GeronimoLog.debug(66) | Thread[pool-2-thread-14,5,main]:
lock(iid=5609, time=1MICROSECONDS)
18:22:28,854 DEBUG [InstanceLockManager] Thread[pool-2-thread-14,5,main]:
lock(iid=5609, time=1MICROSECONDS)
DEBUG - GeronimoLog.debug(66) | Thread[pool-2-thread-14,5,main]:
lock(iid=5609, time=1MICROSECONDS)-->GRANTED
18:22:28,854 DEBUG [InstanceLockManager] Thread[pool-2-thread-14,5,main]:
lock(iid=5609, time=1MICROSECONDS)-->GRANTED
DEBUG - GeronimoLog.debug(66) | >>
handleWorkEvent(jobData={type=INVOKE_RESPONSE, mexid=hqejbhcnphr2muh7icf4ww,
channel=39, iid=5609})
18:22:28,854 DEBUG [BpelProcess] >>
handleWorkEvent(jobData={type=INVOKE_RESPONSE, mexid=hqejbhcnphr2muh7icf4ww,
channel=39, iid=5609})
DEBUG - GeronimoLog.debug(66) | BpelRuntimeContextImpl created for instance
5609. INDEXED
STATE={OSequence#103-archiveProcessSequence::4=[SEQUENCE(self=(OSequence#103-archiveProcessSequence,TerminationChannel#6,ParentScopeChannel#8),
linkframe=org.apache.ode.bpel.runtime.LinkFrame@1c4234c, remaining=[{OScope
'Scope2' id=153}, {OScope 'Scope3' id=233}, {OAssign : InitFinishRunRequest,
joinCondition=null}, {OScope 'invokeFinishRun' id=582}, {OAssign : Assign,
joinCondition=null}, OReply#599-endArchiveProcess])],
OInvoke#166-invokeLogRun::23=[ACTIVITYGUARD(...)], {OScope 'invokeLogRun'
id=165}::22=[SCOPE(...)], {OScope 'Scope2' id=153}::15=[ACTIVITYGUARD(...)],
{OScope 'Scope5' id=102}::2=[ACTIVE(...)], {OScope 'Scope5'
id=102}::2=[SCOPE(...)], {OScope 'Scope2' id=153}::16=[ACTIVE(...)], {OScope
'Scope2' id=153}::16=[SCOPE(...)], {OScope '__PROCESS_SCOPE:cisArchive'
id=3}::0=[SCOPE(...)], {OScope 'Scope5' id=102}::1=[ACTIVITYGUARD(...)],
OSequence#154-dmsArchiveStart::18=[SEQUENCE(self=(OSequence#154-dmsArchiveStart,TerminationChannel#27,ParentScopeChannel#29),
linkframe=org.apache.ode.bpel.runtime.LinkFrame@1c4234c, remaining=[{OScope
'invokeLogRun' id=165}, {OAssign : initDmsArchiveStartRequest,
joinCondition=null}, {OScope 'invokeDmsArchiveStart' id=191}, {OAssign :
initDocumentIds, joinCondition=null}])],
OSequence#154-dmsArchiveStart::17=[ACTIVITYGUARD(...)],
OSequence#103-archiveProcessSequence::3=[ACTIVITYGUARD(...)], {OScope
'__PROCESS_SCOPE:cisArchive' id=3}::0=[ACTIVE(...)],
OInvoke#166-invokeLogRun::24=[INVOKE(...)], {OScope 'invokeLogRun'
id=165}::22=[ACTIVE(...)], {OScope 'invokeLogRun'
id=165}::21=[ACTIVITYGUARD(...)]}
18:22:28,884 DEBUG [BpelRuntimeContextImpl] BpelRuntimeContextImpl created
for instance 5609. INDEXED
STATE={OSequence#103-archiveProcessSequence::4=[SEQUENCE(self=(OSequence#103-archiveProcessSequence,TerminationChannel#6,ParentScopeChannel#8),
linkframe=org.apache.ode.bpel.runtime.LinkFrame@1c4234c, remaining=[{OScope
'Scope2' id=153}, {OScope 'Scope3' id=233}, {OAssign : InitFinishRunRequest,
joinCondition=null}, {OScope 'invokeFinishRun' id=582}, {OAssign : Assign,
joinCondition=null}, OReply#599-endArchiveProcess])],
OInvoke#166-invokeLogRun::23=[ACTIVITYGUARD(...)], {OScope 'invokeLogRun'
id=165}::22=[SCOPE(...)], {OScope 'Scope2' id=153}::15=[ACTIVITYGUARD(...)],
{OScope 'Scope5' id=102}::2=[ACTIVE(...)], {OScope 'Scope5'
id=102}::2=[SCOPE(...)], {OScope 'Scope2' id=153}::16=[ACTIVE(...)], {OScope
'Scope2' id=153}::16=[SCOPE(...)], {OScope '__PROCESS_SCOPE:cisArchive'
id=3}::0=[SCOPE(...)], {OScope 'Scope5' id=102}::1=[ACTIVITYGUARD(...)],
OSequence#154-dmsArchiveStart::18=[SEQUENCE(self=(OSequence#154-dmsArchiveStart,TerminationChannel#27,ParentScopeChannel#29),
linkframe=org.apache.ode.bpel.runtime.LinkFrame@1c4234c, remaining=[{OScope
'invokeLogRun' id=165}, {OAssign : initDmsArchiveStartRequest,
joinCondition=null}, {OScope 'invokeDmsArchiveStart' id=191}, {OAssign :
initDocumentIds, joinCondition=null}])],
OSequence#154-dmsArchiveStart::17=[ACTIVITYGUARD(...)],
OSequence#103-archiveProcessSequence::3=[ACTIVITYGUARD(...)], {OScope
'__PROCESS_SCOPE:cisArchive' id=3}::0=[ACTIVE(...)],
OInvoke#166-invokeLogRun::24=[INVOKE(...)], {OScope 'invokeLogRun'
id=165}::22=[ACTIVE(...)], {OScope 'invokeLogRun'
id=165}::21=[ACTIVITYGUARD(...)]}
DEBUG - GeronimoLog.debug(66) | InvokeResponse event for iid 5609
18:22:28,904 DEBUG [BpelProcess] InvokeResponse event for iid 5609
DEBUG - GeronimoLog.debug(66) | Invoking message response for mexid
hqejbhcnphr2muh7icf4ww and channel 39
18:22:28,904 DEBUG [BpelRuntimeContextImpl] Invoking message response for
mexid hqejbhcnphr2muh7icf4ww and channel 39
DEBUG - GeronimoLog.debug(66) | Triggering response
18:22:28,904 DEBUG [BpelRuntimeContextImpl] Triggering response
INFO - GeronimoLog.info(79) | ActivityRecovery: Registering activity 23,
failure reason: Error sending message
(mex={PartnerRoleMex#hqejbhcnphr2muh7icf4ww [PID
{http://com.ibm.de.cis/archive}cisArchive-40] calling
org.apache.ode.bpel.epr.URLEndpoint@165ded3.logRun(...)}): LogFaultException
on channel 40
18:22:28,904 INFO  [BpelRuntimeContextImpl] ActivityRecovery: Registering
activity 23, failure reason: Error sending message
(mex={PartnerRoleMex#hqejbhcnphr2muh7icf4ww [PID
{http://com.ibm.de.cis/archive}cisArchive-40] calling
org.apache.ode.bpel.epr.URLEndpoint@165ded3.logRun(...)}): LogFaultException
on channel 40
DEBUG - GeronimoLog.debug(66) | Setting execution state on instance 5609
18:22:28,904 DEBUG [BpelRuntimeContextImpl] Setting execution state on
instance 5609
DEBUG - GeronimoLog.debug(66) | Thread[pool-2-thread-14,5,main]:
unlock(iid=5609)
18:22:28,934 DEBUG [InstanceLockManager] Thread[pool-2-thread-14,5,main]:
unlock(iid=5609)

It seems that Axis2 cannot handle my exceptions.
The exception is defined in the xsd for the wsdl:

<xsd:element name="LogFault">
        <xsd:annotation>
            <xsd:documentation>
				fault element for handling errors during the logservice
			</xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element ref="types:faultCode"/>
                <xsd:element ref="types:faultString"/>
                <xsd:element ref="types:faultActor"/>
                <xsd:element ref="types:faultDetail"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>

If I invoke the service operation via soap-ui, I get following response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Server</faultcode>
         <faultstring>LogFaultException</faultstring>
         <detail>
            <ns2:LogFault
xmlns:ns2="http://cis.log.interface.de.ibm.com/types">
               <s83:faultCode
xmlns:s83="http://cis.de.ibm.com/simpleTypes">LOGEX002</s83:faultCode>
               <s84:faultString
xmlns:s84="http://cis.de.ibm.com/simpleTypes">Database for LogService not
available.</s84:faultString>
               <s85:faultActor
xmlns:s85="http://cis.de.ibm.com/simpleTypes">logRun</s85:faultActor>
               <s86:faultDetail
xmlns:s86="http://cis.de.ibm.com/simpleTypes">no
stacktrace.</s86:faultDetail>
            </ns2:LogFault>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>

By adding 

<ext:failureHandling xmlns:ext="http://ode.apache.org/activityRecovery">
                        <ext:faultOnFailure>true</ext:faultOnFailure>
                    </ext:failureHandling>

to the sequence of the scope where the error occured, the first catch of the
global fault handler is executed, whether it fits to the thrown error or
not. 

Does anybody know what´s going wrong in my case?

Regards,
Jens
-- 
View this message in context: http://www.nabble.com/Error-handling-in-bpel-processes-tf4555881.html#a13002294
Sent from the Apache Ode User mailing list archive at Nabble.com.


Mime
View raw message