[BTS]10022错误如何处理?


就差提交了,结果点错了,没存就关了!还得重写!!!!


    今日,流程继续开发,把原来的流程增加更多的日志、状态。方便以后查询消息处理结果。但,流程复杂了,问题也就多多了。




Event Type: Error
Event Source: XLANG/s
Event Category: None
Event ID: 10022
Date:  2/28/2008
Time:  5:03:26 PM
User:  N/A
Computer: LABS
Description:
Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'EIAC.OA.NotificationSystem.Orchestrations.Main(a44769cf-20b3-668b-e434-e1b03b6f84c2)'.
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: 7f7a5fc9-882c-41d4-abf1-4098dcf66126
Shape name: Construct msgUpdateOCSLog
ShapeId: 869f1e47-bfc2-46bf-b425-a85cbcc46b06
Exception thrown from: segment 6, progress 2
Inner exception: A failure occurred while evaluating the distinguished field sync.after.OCSMessageLog.StateID against the message part data. The message part data does not contain at least one of the nodes specified by the XPath expression (listed below) that corresponds to the distinguished field. The cause for this error may be that the message part data has not been initialized or that the message part data does not conform to the message part schema. Ensure that the message part data is initialized correctly. XPath expression: /*[local-name()='UpdateOCSLogRequest' and namespace-uri()='http://EIAC.OA.NotificationSystem.UpdateOCSLog']/*[local-name()='sync' and namespace-uri()='http://EIAC.OA.NotificationSystem.UpdateOCSLog']/*[local-name()='after' and namespace-uri()='http://EIAC.OA.NotificationSystem.UpdateOCSLog']/*[local-name()='OCSMessageLog' and namespace-uri()='http://EIAC.OA.NotificationSystem.UpdateOCSLog']/@*[local-name()='StateID' and namespace-uri()='']
       
Exception type: XPathUpdateException
Source: Microsoft.XLANGs.Engine
Target Site: Void SetDistinguishedField(System.String, System.Object)
The following is a stack trace that identifies the location where the exception occured

   at Microsoft.XLANGs.Core.XSDPart.SetDistinguishedField(String dottedPath, Object val)
   at EIAC.OA.NotificationSystem.Orchestrations.Main.segment6(StopConditions stopOn)
   at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)

       

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.





仔细检查一下错误中提到的消息,它的初始化如下



后面有一赋值操作

msgUpdateOCSLogRequest.parameters.sync.after.OCSMessageLog.StateID = m_strStateID;

通过ErrorLog,错误大至就是发生在这里。





    分析一下原因,大至是由于在Mapping中没有对StateID字段赋值,造成它在xml中是不存在的,所以,后面的赋值操作中,用属性去访问时会报错的。如同一个类的成员变量还没有赋值,就去调用这个成员变量的方法一样。



找一个最简单的方法:







    以后,在构造有属性的消息时,把这些性都赋上个初值,也为以后调用时创建便利。

原文地址:https://www.cnblogs.com/xuzhong/p/1085219.html