在Windows Server 2003上,我们使用以下批处理命令每周一次备份Windows消息队列中的消息(http://technet.microsoft.com/en-us/library/cc773213%28v=ws.10%29的.aspx):
cd "C:\backup"
echo y | del *.* /Q /s
echo y | mqbkup -b C:\backup
我们有一台C#ASP.NET 3.5 Web应用程序在与此消息队列交互的同一台机器上运行。
备份运行后,当我们尝试从Web应用程序访问Web应用程序的消息队列时。抛出以下错误(如果应用程序重建,它会消失,如预期的那样)。 我如何解决它?请帮忙。感谢。
*Server Error in '/' Application.
The Queue manager service has been restarted. The queue handle is stale and should be closed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Messaging.MessageQueueException: The Queue manager service has been restarted. The queue handle is stale and should be closed.
Source Error: Line 107: Message[] msgs = Global.getMessageQueue()[i].GetAllMessages();
Stack Trace:
[MessageQueueException (0x80004005): The Queue manager service has been restarted. The queue handle is stale and should be closed.]
System.Messaging.MessageEnumerator.get_Handle() +168
System.Messaging.MessageEnumerator.MoveNext(TimeSpan timeout) +103
System.Messaging.MessageEnumerator.MoveNext() +47
System.Messaging.MessageQueue.GetAllMessages() +41
engine.resultData.Page_Load(Object sender, EventArgs e) in C:\retentionSys_08\master\resultData.aspx.cs:107
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.4028*