[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/archive/2008/02/28/1085219.html

国人开发强悍IOCP代码,全部代码 其中一个单元的代码: unit uIOCompletionPort; interface uses Windows, WinSock2, uWin32Const, uException, uDIProtocol, uDIClientChannel; type TIOCompletionPort = class private m_hCompletionPort: Thandle; private procedure CreateCompletionPort; public function AssociateSocketWithCompletionPort( hDevice: THandle; dwCompletionKey: DWORD): Boolean; function GetIOCompletionStatus( var FClientChannel: TDIClientChannel; var pHandleData: PPerHandleData; var dwIoSize: DWORD): Boolean; overload; function GetIOCompletionStatus( var FClientChannel: TDIClientChannel; var pHandleData: PPerHandleData; var dwIoSize: DWORD; dwMilliseconds: DWORD): Boolean; overload; function PostIOCompletionStatus( lpCompletionKey: DWORD; lpOverlapped: POverlapped; lpNumberOfBytesTransferred: DWORD): Boolean; public constructor Create; destructor Destroy; override; end; implementation constructor TIOCompletionPort.Create; begin inherited Create; CreateCompletionPort; end; destructor TIOCompletionPort.Destroy; begin CloseHandle(m_hCompletionPort); inherited Destroy; end; procedure TIOCompletionPort.CreateCompletionPort; var s: TSocket; begin s := Winsock2.socket(AF_INET, SOCK_STREAM, IPPROTO_IP); if (s = Winsock2.INVALID_SOCKET) then raise TException.Create(ErrWin32Error, GetLastError(), 'Winsock2.socket'); m_hCompletionPort := CreateIOCompletionPort(s, 0, 0, 0); if (m_hCompletionPort = 0) then raise TException.Create(ErrWin32Error, GetLastError(), 'CreateIOCompletionPort'); Winsock2.closesocket(s); end; function TIOCompletionPort.AssociateSocketWithCompletionPort( hDevice: THandle; dwCompletionKey: DWORD ): Boolean; var h: THandle; begin Result := TRUE; h := CreateIOCompletionPort(hDevice, m_hCompletionPort, dwCompletionKey, 0); if (h m_hCompletionPort) then begin Result := FALSE; raise TException.Create(ErrWin32Error, GetLastError(), 'AssociateSocketWithCompletionPort'); end; end; function TIOCompletionPort.GetIOCompletionStatus( var FClientChannel: TDIClientChannel; var pHandleData: PPerHandleData; var dwIoSize: DWORD): Boolean; begin Result := GetQueuedCompletionStatus( m_hCompletionPort, dwIOSize, DWORD(FClientChannel), POVERLAPPED(pHandleData), INFINITE ); end; function TIOCompletionPort.GetIOCompletionStatus( var FClientChannel: TDIClientChannel; var pHandleData: PPerHandleData; var dwIoSize: DWORD; dwMilliseconds: DWORD): Boolean; var bRet: Boolean; nLastError: DWORD; begin bRet := TRUE; if FALSE = GetQueuedCompletionStatus( m_hCompletionPort, dwIOSize, DWORD(FClientChannel), POVERLAPPED(pHandleData), INFINITE ) then begin nLastError := GetLastError(); if (nLastError WAIT_TIMEOUT) then raise TException.Create(ErrWin32Error, GetLastError(), 'GetQueuedCompletionStatus'); bRet := FALSE; end; Result := bRet; end; function TIOCompletionPort.PostIOCompletionStatus( lpCompletionKey: DWORD; lpOverlapped: POverlapped; lpNumberOfBytesTransferred: DWORD): Boolean; begin Result := PostQueuedCompletionStatus( m_hCompletionPort, lpNumberOfBytesTransferred, lpCompletionKey, lpOverlapped ); end; end.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值