here is how to use Exception Handling framework from Orchestration
This post is about couple of errors that consumed lots of time to figure out when testing an implementation that uses ESB Exception Handling framework.
|
in windows event log (BizTalk ESB Toolkit 2.1): Object reference not set to an instance of an object. Source: Microsoft.Practices.ESB.ExceptionHandling.PipelineComponents.ProcessFault Method: Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(Microsoft.BizTalk.Component.Interop.IPipelineContext, Microsoft.BizTalk.Message.Interop.IBaseMessage) Error Source: Microsoft.Practices.ESB.ExceptionHandling.PipelineComponents Error TargetSite: Void WriteHeaderFailedMessageRouting(System.Xml.XmlTextWriter, Microsoft.BizTalk.Message.Interop.IBaseMessage, System.Object ByRef) Error StackTrace: at Microsoft.Practices.ESB.ExceptionHandling.PipelineComponents.ProcessFault.WriteHeaderFailedMessageRouting(XmlTextWriter writer, IBaseMessage pInMsg, Object& portName) |
Reason: // Add the message to the Fault Message
Microsoft.Practices.ESB.ExceptionHandling.ExceptionMgmt.AddMessage(MsgFaultMultipart, MsgInboundMessage);
this line is required in Orchestration code for ProcessFault pipeline component to work. |
| in windows event log: xlang/s engine event log entry: Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service (a42d0855-ec7c-3dc7-5e9f-442c84746e85)’. If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception. InstanceId: 003a57d2-42b3-4a20-8cfa-a03b810df217 Shape name: Send_1 ShapeId: ad8c422b-4b45-41c5-bd0b-5ce958491e1e Exception thrown from: segment 5, progress 8 Inner exception: Exception occurred when persisting state to the database. Source: Microsoft.XLANGs.BizTalk.Engine Target Site: Void Commit() The following is a stack trace that identifies the location where the exception occured at Microsoft.BizTalk.XLANGs.BTXEngine.BTXXlangStore.Commit() at Microsoft.XLANGs.Core.ServiceContext.PendingCommit(Boolean ignore, XMessage msg) at Microsoft.XLANGs.Core.ExceptionHandlingContext.PendingCommit(Boolean ignoreCommit, XMessage msg) at Microsoft.XLANGs.Core.ExceptionHandlingContext.PendingCommit(Boolean ignoreCommit, XMessage msg) at Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase.SendMessage(Int32 iOperation, XLANGMessage msg, Correlation[] initCorrelations, Correlation[] followCorrelations, Context cxt, Segment seg, ActivityFlags flags) at XX.segment5(StopConditions stopOn) at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp) Additional error information: A batch item failed persistence Item-ID 5f10694f-5a1f-4b05-ab88-6c9edbd1140d OperationType MAIO_CommitBatch Status -1061151998 ErrorInfo The published message could not be routed because no subscribers were found. . Additional error information: Failed to publish (send) a message in the batch. This is usually because there is no one expecting to receive this message. The error was The published message could not be routed because no subscribers were found. with status -1061151998.
|
| Reason: 1. Add Microsoft.Practices.ESB in your Application’s References 2. configure a SQL send port with ProcessFault pipeline component to insert exception in ExceptionDB. (Alternatively, we can use All.Exceptions send port that was created with ESB Core installation) |

January 3, 2013 at 8:21 pm
In your first error – how do you add the line to the Fault Message?
I’m looking at the Fault Message Schema.
May 17, 2013 at 11:16 am
Thanks …….. helped me resolve an error