相关性,持久性和WorkflowServiceHost共同提供了NullReferenceException [英] Correlation, persistence and WorkflowServiceHost conspire to give a NullReferenceException

查看:71
本文介绍了相关性,持久性和WorkflowServiceHost共同提供了NullReferenceException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

在以下位置的线程中:
    http://social.msdn.microsoft.com /Forums/zh-CN/wfprerelease/thread/418b3554-8572-472d-bd94-37e4d1ac3652/

我被告知我应该使用WorkflowServiceHost来使Delay在持久化Pick中工作.在尝试完成该任务时,我遇到了另一个问题.

我现在有一个简单的WCF客户端,该客户端将消息发送到我的System.ServiceModel.Activities.WorkflowServiceHost.我配置了SQL持久性,并且将其设置为在5秒钟的超时后卸载实例.

我让客户端发送具有实例特定ID的消息,并且设置了相关性以使用此ID选择合适的实例.

持久性似乎可以工作("Instances"的XmlData列中有一些看起来合适的东西).

关联似乎可以工作(消息确实可以发送)

,但是当实例被卸载时,一切都崩溃了.如果我在实例卸载之前发送了一条消息,则它(反复)得到了正确的处理.如果将其卸载,则会出现以下异常:

System.ServiceModel.FaultException`1 [System.ServiceModel.ExceptionDetail]:对象引用未设置为对象的实例. (故障详细信息等于ExceptionDetail,可能由IncludeExceptionDetailInFaults = true创建,其值为:
System.NullReferenceException:对象引用未设置为对象的实例.
在系统上. Runtime.AsyncResult.End [TAsyncResult](IAsyncResult result)
在System.ServiceModel.Activities.Dispatcher.ControlOperationInvoker.InvokeEnd(对象实例,Object []&输出,IAsyncResult结果)
  位于System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeEnd(MessageRpc& rpc)
 位于System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage7(MessageRpc& n rpc)sp在System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)处.

那个代码都不是我的,并且没有达到接收"工作流的断点,所以我对如何调试此方法感到困惑.

可能是相关性设置不正确(尽管它本身ems与加载的实例一起使用),或者没有正确设置持久性(尽管它似乎确实可以持久地保留),或者当WorkflowServiceHost尝试加载实例时,我没有配置我需要做的事情(尽管那里没有似乎甚至无法知道这是否已发生).关于如何找出解决办法的任何想法吗?

干杯,

     Geoff

Hi there,

In the thread at:
    http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/418b3554-8572-472d-bd94-37e4d1ac3652/

I was advised that I should use the WorkflowServiceHost to get Delay working in a persisted Pick. In trying to get that done, I have come across another problem.

I now have a simple WCF client that sends messages to my System.ServiceModel.Activities.WorkflowServiceHost. I have SQL persistence configured, and I have it set to unload instances after a 5 second timeout.

I have the client send messages with an instance-specific ID, and I have correlation set to use this ID to pick the proper instance.

The persisting seems to work (there's something in the Instances' XmlData column that looks appropriate).

The correlation seems to work (messages do go to the proper instance).

But it all falls apart when the instance is unloaded.  If I send a message before the instance is unloaded, it's (repeatedly) handled properly. If it's unloaded, I get the following exception:

System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Object reference not set to an instance of an object. (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Activities.Dispatcher.ControlOperationInvoker.InvokeEnd(Object instance, Object[]& outputs, IAsyncResult result)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeEnd(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage7(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)).

None of that code is mine, and it's not hitting the 'Receive' workflow breakpoint, so I'm at a loss as to how to debug this.

It could be that correlation isn't set up properly (although it seems to work with loaded instances), or that persistence isn't set up properly (although it does seem to persist properly), or that I haven't configured something I need to do when the WorkflowServiceHost tries to load instances (although there doesn't seem to be any way to even know if this has happened). Any ideas on how I can find out how to fix this?

Cheers,

    Geoff

推荐答案

能否发布您的web.config文件.

Can you please post your web.config file.


这篇关于相关性,持久性和WorkflowServiceHost共同提供了NullReferenceException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆