Advanced Routing Error

Hi All,

I am trying to schedule a report to run every afternoon with the advanced routing feature on it so that the report will automatically be emailed to the correct people. When the report runs every afternoon it is getting the following error, but when I run it manually everything works correctly. Does anyone have any experience with this issue?

Thanks in advance for your help!

> Program Ice.Services.Lib.RunTask raised an unexpected exception with the following message: RunTask: [A]Ice.Lib.Reporting.Model.RuleWorkflowDefinition cannot be cast to [B]Ice.Lib.Reporting.Model.RuleWorkflowDefinition. Type A originates from 'Ice.Lib.RoutingBreakingRules, Version=3.1.500.0, Culture=neutral, PublicKeyToken=5d3fa3c7105d7992' in the context 'LoadNeither' in a byte array. Type B originates from 'Ice.Lib.RoutingBreakingRules, Version=3.1.500.0, Culture=neutral, PublicKeyToken=5d3fa3c7105d7992' in the context 'LoadNeither' in a byte array.

Stack Trace:
at Ice.Lib.Reporting.Model.RuleWorkflowPersister1.Load(String persistedInstance) in c:\_Releases\ICE\3.1.500\Current\Source\Shared\Lib\RoutingBreakingRules\Model\RuleWorkflowPersister.cs:line 29 at Ice.Core.RptBase.ReportSsrsDatabaseBuilder1.CreateWorkflow(ByteArrayCacheWithTemporaryBackingFile reportCache, Func2 executeCommand, Func2 executeReader, SqlObjectsCreated sqlObjectsCreated) in C:_Releases\ICE\3.1.500.16\Source\Server\Internal\Lib\TaskLib\RptBase\ReportSsrsDatabaseBuilder.cs:line 152
at Ice.Core.RptBase.ReportSsrsDatabaseBuilder1.RouteAndBreakReport(Func2 executeCommand, Func2 executeReader, SqlObjectsCreated sqlObjectsCreated) in C:\_Releases\ICE\3.1.500.16\Source\Server\Internal\Lib\TaskLib\RptBase\ReportSsrsDatabaseBuilder.cs:line 248 at Ice.Core.RptBase.ReportDatabaseBuilder1.XMLClose() in C:_Releases\ICE\3.1.500.16\Source\Server\Internal\Lib\TaskLib\RptBase\ReportDatabaseBuilder.cs:line 142
at Ice.Core.RptTaskBase1.XMLClose() in C:\_Releases\ICE\3.1.500.16\Source\Server\Internal\Lib\TaskLib\RptBase\RptTaskBase.cs:line 130 at Ice.Hosting.TaskCaller.InnerExecuteTask(IceDataContext newContext) in C:\_Releases\ICE\3.1.500.16\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 93 at Ice.Hosting.TaskCaller.ExecuteTask() in C:\_Releases\ICE\3.1.500.16\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 54 at Ice.Lib.RunTask.BpmFriendlyTaskLauncher.Run(String sessionIdPrefix, IceContext db, Action taskRunner) in C:\_Releases\ICE\3.1.500.16\Source\Server\Services\Lib\RunTask\BpmFriendlyTaskLauncher.cs:line 63 at Ice.Services.Lib.RunTaskSvc.InnerRunTask(Int64 ipTaskNum, Boolean suppressTransaction) in C:\_Releases\ICE\3.1.500.16\Source\Server\Services\Lib\RunTask\RunTask.cs:line 526 at Ice.Services.Lib.RunTaskSvc.InnerRunTask(Int64 ipTaskNum, Boolean suppressTransaction) in C:\_Releases\ICE\3.1.500.16\Source\Server\Services\Lib\RunTask\RunTask.cs:line 526 at Ice.Services.Lib.RunTaskSvcFacade.RunTask(Int64 ipTaskNum) in C:\_Releases\ICE\3.1.500.16\Source\Server\Services\Lib\RunTask\RunTaskSvcFacade.cs:line 87 at SyncInvokeRunTask(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func2 func) in C:_Releases\ICE\3.1.500.16\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 59
at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func2 func) in C:\_Releases\ICE\3.1.500.16\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 28 at Epicor.Hosting.Wcf.EpiOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in C:\_Releases\ICE\3.1.500.16\Source\Framework\Epicor.System\Hosting\Wcf\EpiOperationInvoker.cs:line 23 at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext) at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext) at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result) at System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result) at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) at System.ServiceModel.Channels.SecurityChannelListener1.ReceiveItemAndVerifySecurityAsyncResult`2.InnerTryReceiveCompletedCallback(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.TryReceiveAsyncResult.OnReceive(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.SynchronizedMessageSource.ReceiveAsyncResult.OnReceiveComplete(Object state)
at System.ServiceModel.Channels.SessionConnectionReader.OnAsyncReadComplete(Object state)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Security.NegotiateStream.ProcessFrameBody(Int32 readBytes, Byte buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.NegotiateStream.ReadCallback(AsyncProtocolRequest asyncRequest)
at System.Net.AsyncProtocolRequest.CompleteRequest(Int32 result)
at System.Net.FixedSizeReader.CheckCompletionBeforeNextRead(Int32 bytes)
at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.ConnectionStream.IOAsyncResult.OnAsyncIOComplete(Object state)
at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs e)
at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationSuccess(SocketError socketError, Int32 bytesTransferred, SocketFlags flags)
at System.Net.Sockets.SocketAsyncEventArgs.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

Hello,
I ran into this “…LoadNeither…” error message before and here is what fixed it for me:

Through some deductive reasoning, I realized that the last time my APR Breaking and Routing Rules worked were before I recycled the AppServer. I found an EpiCare answerbook article in which someone had reported an error with the “LoadNeither” text inside it. There were some suggestions to recycle the AppServer so that triggered my thoughts that maybe during my last Recycle of the AppServer something happened to the APR Breaking and Routing Rules process. So I first stopped the Task Agent and then Recycled the AppServer and then restarted the Task Agent it seems to be working! YAAAAAY! :smiley: So be aware (if you aren’t already) that sometimes a recycle of the AppServer (I’m assuming without stopping the Task Agent first) can cause APR Breaking and Routing Rules to error out with no clear indication as to why… :confused:

:stop_sign: WARNING!!! :warning: :skull_and_crossbones: :warning: :shark: (The shark was just to get your attention…!)
Please understand the implications and follow all the necessary precautions before restarting the Task Agent and Recycling the AppServer in your Live environment!!!