Sunday, September 23, 2012

BizTalk Troubleshooting

  • Error :
xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'MY.Orchestration.Client(46b8790f-cf99-d0ce-5443-7b22e01f8a3f)'.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 86243d42-5a79-4e88-b051-b9eab96160d2
Shape name:
ShapeId:
Exception thrown from: segment -1, progress -1
Inner exception: Received unexpected message type '' does not match expected type 'http://Microsoft.LobServices.Sap/2007/03/Rfc/#BAPI_EXCHANGERATE_CREATEResponse'.
       
Exception type: UnexpectedMessageTypeException
Source: Microsoft.XLANGs.Engine
Target Site: Void VerifyMessage(Microsoft.XLANGs.Core.Envelope, System.String, Microsoft.XLANGs.Core.Context, Microsoft.XLANGs.Core.OperationInfo)
The following is a stack trace that identifies the location where the exception occured

   at Microsoft.XLANGs.Core.PortBinding.VerifyMessage(Envelope env, String typeName, Context cxt, OperationInfo op)
   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBinding.VerifyMessage(Envelope env, String typeName, Context cxt, OperationInfo op)
   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXLogicalPortBinding.VerifyMessage(Envelope env, String typeName, Context cxt, OperationInfo op)
   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase.VerifyTransport(Envelope env, Int32 operationId, Context ctx)
   at Microsoft.XLANGs.Core.Subscription.Receive(Segment s, Context ctx, Envelope& env, Boolean topOnly)
   at Microsoft.XLANGs.Core.PortBase.GetMessageId(Subscription subscription, Segment currentSegment, Context cxt, Envelope& env, CachedObject location)
   at MY.Test.segment2(StopConditions stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp 
Solution:
Go to the Send port & change the send pipeline to correct one
  • Error :
The adapter failed to transmit message going to send port "SendToDesk" with URL "C:\ DropFile\%SourceFileName%". It will be retransmitted after the retry interval specified for this Send Port. Details:"The FILE send adapter cannot open file C:\DropFile\Test.csv for writing.
Details: The file exists.

     Solution:
Change Copy mode to “Overwrite” under File Adapter transport properties.
  • Error :
The receive location "BizTalkDebatching_1.0.0.0_BizTalkDebatching.XPathSample_LargeMsgRecPort_a5d2935b60d898e2_ReceiveLocation" with URL "C:\In\*.xml" is shutting down. Details:"The FILE receive adapter cannot monitor receive location C:\In\. ".
    Solution:
Receive folder has been deleted or not available
  • Error :
xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'MY.Orchestration. Client(46b8790f-cf99-d0ce-5443-7b22e01f8a3f)'.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: d21e23a1-af25-4ab8-ac64-dd56f3533b7d
Shape name: Send_2
ShapeId: 5fe691c8-de81-4dbb-a6d0-6f6c2b97d2dd
Exception thrown from: segment 1, progress 69
Inner exception: Exception occurred when persisting state to the database.
       
Exception type: PersistenceException
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.Service.Persist(Boolean dehydrate, Context ctx, Boolean idleRequired, Boolean finalPersist, Boolean bypassCommit, Boolean terminate)
   at Microsoft.XLANGs.Core.LongRunningTransaction.PendingCommit(Boolean ignore, XMessage msg)
   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase.SendMessage(Int32 iOperation, XLANGMessage msg, Correlation[] initCorrelations, Correlation[] followCorrelations, Context cxt, Segment seg, ActivityFlags flags)
   at MY.Client.segment1(StopConditions stopOn)
   at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
Additional error information:

        A batch item failed persistence Item-ID 9e50fa72-5f37-4add-80c3-11d7d86d0a6d OperationType MAIO_CommitBatch Status -1061151960 ErrorInfo An error occurred when accessing the part data or one of its fragments. The part data or fragment may not exist in the database. .
       
Exception type: PersistenceItemException
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 An error occurred when accessing the part data or one of its fragments. The part data or fragment may not exist in the database.  with status -1061151960.
       
Exception type: PublishMessageException

Solution:
Test the Mapper using Test Map (reason the Mapper got failed at validation )
  • Error :
xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'MY.Test(f9990179-a4eb-c15d-2f28-56241cc0c197)'.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: baf6446b-0f05-4435-88f2-15487237cbee
Shape name: ConstructMessage_ExchangeListRequest
ShapeId: 90c1630b-3199-4ad2-9ece-12a1eea00be2
Exception thrown from: segment 1, progress 6
Inner exception: The remote server returned an error: (407) Proxy Authentication Required.
       
Exception type: WebException
Source: MY.Utilities
Target Site: System.Xml.XmlDocument GetExchangeRates(System.String)
The following is a stack trace that identifies the location where the exception occured

   at MY. Rates(String day)
   at MY..Process.segment1(StopConditions stopOn)
   at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
Solution:
Add below to the BizTalk.config


<system.net>
    <defaultProxy useDefaultCredentials="true">
      <proxy usesystemdefault="True" />
    </defaultProxy>
  </system.net>
<system.net>
                                <defaultProxy enabled="true"/>
                </system.net>
                <system.web>
                                <identity impersonate="true" />
                </system.web>

  • Error :
This is common error for passing wrong request to the service
Exception thrown from: segment -1, progress -1
Inner exception: Received unexpected message type 'http://schemas.xmlsoap.org/soap/envelope/#Fault' does not match expected type 'http://schemas.myl.com.au/11/2009#DataResponse'.
       
Exception type: UnexpectedMessageTypeException
Source: Microsoft.XLANGs.Engine
Target Site: Void VerifyMessage(Microsoft.XLANGs.Core.Envelope, System.String, Microsoft.XLANGs.Core.Context, Microsoft.XLANGs.Core.OperationInfo)
The following is a stack trace that identifies the location where the exception occurred
Solution:
Not passing request parameters correctly. To find the correct error go to the suspend message & see message body.  You can see the correct error in the message body
Ex : 
<s:Fault xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:DeserializationFailed</faultcode><faultstring xml:lang="en-AU">The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://schemas.my.com.au/SampleMethod. The InnerException message was 'Invalid enum value '' cannot be deserialized into type 'MY.Test.SampleMethod'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.'.  Please see InnerException for more details.</faultstring><detail><ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><HelpLink i:nil="true" /><InnerException><HelpLink i:nil="true" /><InnerException i:nil="true" /><Message>Invalid enum value '' cannot be deserialized into type 'MY.Test.SampleMethod'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.</Message><StackTrace>   at System.Runtime.Serialization.EnumDataContract.ReadEnumValue(XmlReaderDelegator reader)
   at System.Runtime.Serialization.EnumDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract&amp; dataContract)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns)
   at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)
   at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName)
   at System.Runtime.Serialization.DataContractSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName)
   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)</StackTrace><Type>System.Runtime.Serialization.SerializationException</Type></InnerException><Message>The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://schemas.my.com.au/Test:SampleMethod. The InnerException message was 'Invalid enum value '' cannot be deserialized into type 'MY.Test.SampleMethod'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.'.  Please see InnerException for more details.</Message><StackTrace>   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)
   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameter(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)
   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameters(XmlDictionaryReader reader, PartInfo[] parts, Object[] parameters, Boolean isRequest)
   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest)
   at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)
   at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace><Type>System.ServiceModel.Dispatcher.NetDispatcherFaultException</Type></ExceptionDetail></detail></s:Fault>

  • Error :
When publishing new web service as an orchestration the following error comes
There are no orchestrations with public receive ports in this BizTalk assembly
Solution:
Click back and specify a BizTalk assembly containing orchestrations with public receive ports

  • Error :
A message sent to adapter "WCF-SAP" on send port "WcfSendPort_SAPBinding_Rfc_Custom" with URI "sap://CLIENT=xxx;LANG=EN;@A/SAP.my.com/00?RfcSdkTrace=False&AbapDebug=False" is suspended.
 Error details: System.ServiceModel.CommunicationException: The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.

Server stack trace:
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)
 MessageId:  {ADB2D8F5-B493-42F9-8E97-F8654742213A}
 InstanceID: {C09C3341-3F03-4C88-94E7-B4E541149611}
Solution:
SAP Server Down
  • Error
The adapter failed to transmit message going to send port "WcfSendPort_SqlAdapterBinding_Multiple_Custom" with URL "mssql://SqlServer/test /A++?". It will be retransmitted after the retry interval specified for this Send Port. Details:"System.Transactions.TransactionManagerCommunicationException: Communication with the underlying transaction manager has failed. ---> System.Runtime.InteropServices.COMException: The MSDTC transaction manager was unable to push the transaction to the destination transaction manager due to communication problems. Possible causes are: a firewall is present and it doesn't have an exception for the MSDTC process, the two machines cannot find each other by their NetBIOS names, or the support for network transactions is not enabled for one of the two transaction managers. (Exception from HRESULT: 0x8004D02A)
   at System.Transactions.Oletx.ITransactionShim.Export(UInt32 whereaboutsSize, Byte[] whereabouts, Int32& cookieIndex, UInt32& cookieSize, CoTaskMemHandle& cookieBuffer)
   at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)
   --- End of inner exception stack trace ---
Server stack trace:
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)".
The adapter failed to transmit message going to send port "WcfSendPort_SqlAdapterBinding_Multiple_Custom" with URL "mssql://SqlServer/test /A++?". It will be retransmitted after the retry interval specified for this Send Port. Details:"System.Transactions.TransactionManagerCommunicationException: Communication with the underlying transaction manager has failed. ---> System.Runtime.InteropServices.COMException: The MSDTC transaction manager was unable to push the transaction to the destination transaction manager due to communication problems. Possible causes are: a firewall is present and it doesn't have an exception for the MSDTC process, the two machines cannot find each other by their NetBIOS names, or the support for network transactions is not enabled for one of the two transaction managers. (Exception from HRESULT: 0x8004D02A)
   at System.Transactions.Oletx.ITransactionShim.Export(UInt32 whereaboutsSize, Byte[] whereabouts, Int32& cookieIndex, UInt32& cookieSize, CoTaskMemHandle& cookieBuffer)
   at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)
   --- End of inner exception stack trace ---
Server stack trace:
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)".
Solution:
DTC issue. Check the DTC security options of two machines.
  • Error 
The adapter "SQL" raised an error message. Details "Could not load file or assembly 'Microsoft.Data.SqlXml, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.".
Solution:
SQLXML 4.0 with Service Pack 1
  • Error 
This error comes sometimes 
xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'MY.Client(46b8790f-cf99-d0ce-5443-7b22e01f8a3f)'.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 44855170-9b7a-44a7-8584-70fd6d0f2021
Shape name: GetSingleRate
ShapeId: d475b5bb-ecf1-4728-8049-529803ff8d0b
Exception thrown from: segment 1, progress 37
Inner exception: Object reference not set to an instance of an object.
       
Exception type: NullReferenceException
Source: MY.Orchestration
Target Site: Microsoft.XLANGs.Core.StopConditions segment1(Microsoft.XLANGs.Core.StopConditions)
The following is a stack trace that identifies the location where the exception occured

   at MY.Client.segment1(StopConditions stopOn)
   at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)

Solution:
Problem with message assignment. So the better way is

  xmlList = new System.Xml.XmlDocument();
xmlList = RateListSchemaMessage;

// Get a specific node based on the loop count
XPathValue = System.String.Format("//Rates[{0}]", LoopCount);
XmlDoc = new System.Xml.XmlDocument();
xmlNodeValue = xmlList.SelectSingleNode(XPathValue);
// Set the node to an XmlDocument
XmlDoc.LoadXml(xmlNodeValue.OuterXml);

// Set the XML back to a Message to be sent out
SingleXML = XmlDoc;
 
  • Error
When you assign like below , you will get an "illegal dot name" and OutXml function can't be recognized.

NewXml = new System.Xml.XmlDocument();
NewXml=MessageReq;
TestStr="/*[local-name()='Root' and namespace-uri()='http://TestDebatch.SchemaReq']/*[local-name()='DATASOURCES' and namespace-uri()='']["+count+"]";
NewXmlTem = new System.Xml.XmlDocument();
NewXmlTem.LoadXml(NewXml.SelectSingleNode(TestStr).OuterXml);

Solution:

The XMLNode is non-serializable, so it can only be created in atomic scope. Add a scope shape and set its property to atomic scope and add your expression shape and other related shapes in that atomic scope. Please see the reasoning of limitation of serializable variable in orchestrations below:
Why does the compiler require my variable to be serializable?
The XLANGs runtime may persist to the database (dehydrate) your orchestration, including all of its data, at any point (except in the atomic scope). When the orchestration dehydrates and rehydrates, user-defined variables are binary serialized and deserialized. In most cases, you need a serializable object. A non-serializable object can only be declared and used in an atomic scope. The XLANGs compiler gives you compilation errors if you try to use a non-serializable data type outside of an atomic scope.

  • Error
Could not load file or assembly 'MY.Utilities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=75781fbfe6871f6e' or one of its dependencies. The system cannot find the file specified.
       
Exception type: FileNotFoundException
Source: mscorlib
Target Site: System.Reflection.RuntimeAssembly _nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, Boolean, Boolean, Boolean)
The following is a stack trace that identifies the location where the exception occured

Solution:

Assembly is not in the GAC 
GacUtil /i My.Utilities\bin\Debug\'MY.Utilities.dll /f
 
 

2 comments:

Nandika Mirihana said...

Error :
soap:ClientUnmarshalling Error:

Solution :
The passed message is not matched to the Schema. Need to validate this passing message with the schema

Halo said...

Can you Help Me ?

Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'TarsimPoliceDetay.TarsimPoliceDetayOrch(1e912404-3143-e818-d474-c7d523946b45)'.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 565c3a1a-37a1-47f5-8e55-e7a99f9cf00e
Shape name: SavePolicyKeys
ShapeId: be9adc10-2797-440f-94d4-2327c38e43d8
Exception thrown from: segment 3, progress 8
Inner exception: Object reference not set to an instance of an object.

Exception type: NullReferenceException
Source: INET.Library
Target Site: System.Collections.Hashtable insertRecordKeys(System.Xml.XmlDocument)
The following is a stack trace that identifies the location where the exception occured

at INET.Library.clsCommon.insertRecordKeys(XmlDocument docXML)
at TarsimPoliceDetay.TarsimPoliceDetayOrch.segment3(StopConditions stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)