07-24-2014 01:02 PM
Hello,
I'm getting the object reference exception below "randomly" (read: I can't find a pattern or consistently reproduce it) when executing a Timer that fires off a Unity Script from the Workflow Timer Service Administrator:
I don't think it is the script code because I have my code insulated in:
catch (unity.UnityAPIException ux)
{
app.Diagnostics.Write(ux.Message);
app.Diagnostics.Write(ux.StackTrace);
}
catch (System.Exception ex)
{
app.Diagnostics.Write(ex.Message);
app.Diagnostics.Write(ex.StackTrace);
}
and I never get a line number of failure. Also, the script runs successfully (and does what it is supposed to do) despite the exception. I found a similar issue here:
https://www.onbase.com/community/technical_communities/onbase_apis/f/10815/p/17410/34696.aspx#34696
and
https://www.onbase.com/community/technical_communities/onbase_apis/f/10815/t/13645.aspx
Has anyone run into this issue before? It doesn't seem to be tied to manually firing the timer because it has shown up before on a scheduled timer execution.
1) Exception Information
*********************************************
Exception Type: Hyland.Core.Workflow.Exceptions.TaskExecutorException
Message: Task list execution failed: Unexpected error: Object reference not set to an instance of an object.
at Hyland.Core.Unity.Services.SessionCache.RemoveSession(String sessionID)
at Hyland.Core.Unity.AppDomainManager.ExecutionContext.Dispose()
at Hyland.Core.Unity.UnityExecutor.WorkflowExecute(Session session, Int64 operationId, IWorkItemContent content, Element queueElement, PropertyBag sessionPropertyBag, PropertyBag scopedPropertyBag, Int64 batchDocumentsRemaining, Boolean scriptResult)
at Hyland.Core.Workflow.Module.ExecuteUnityScript(Session session, IWorkItemContent item, Int64 batchDocumentsRemaining, Queue queue, UserProperties scopedPropertyBag, Int64 scriptID, Boolean defaultScriptResult)
at Hyland.Core.Workflow.Tasks.Rules.RunUnityScript.ExecutionService.ExecuteImpl(Session session, IWorkItemContent content, Queue queue, ITaskConfiguration configuration, ExecutionArgs args)
at Hyland.Core.Workflow.Tasks.ExecutionServiceBase.Execute(Application app, ExecutionArgs args)
at Hyland.Core.Workflow.Rule.Execute(Session session, IWorkItemContent document, AddInExecutionArgs executionArgs)
Rule: 1400 'SCRIPT: BulkComplete (Unity)'
Type: Sys_RunUnityScript
Data: System.Collections.ListDictionaryInternal
TargetSite: Hyland.Core.Workflow.AddIn.ExecutionResult HandleExecuteOrResume(Hyland.Core.Workflow.TaskExecutorOptions, Hyland.Core.Workflow.SuspendedTask)
HelpLink: NULL
Source: Hyland.Core.Workflow
StackTrace Information
*********************************************
at Hyland.Core.Workflow.TaskExecutor.HandleExecuteOrResume(TaskExecutorOptions options, SuspendedTask resumeTask)
at Hyland.Core.Workflow.TaskExecutor.Execute(TaskExecutorOptions options)
at Hyland.Core.Workflow.TaskExecutor.Execute(Session session, Queue queue, IWorkItemContent document, TaskList taskList, TaskExecutorOptions options, SuspendedTask& suspendedTask)
at Hyland.Core.Workflow.Timer.Execute(Session session, Queue queue, Boolean updateLastExecutionTime, Guid userInterfaceKey)
2) Exception Information
*********************************************
Exception Type: Hyland.Core.Workflow.Exceptions.RuleException
Rule: 1400 'SCRIPT: BulkComplete (Unity)'
Message: Unexpected error: Object reference not set to an instance of an object.
at Hyland.Core.Unity.Services.SessionCache.RemoveSession(String sessionID)
at Hyland.Core.Unity.AppDomainManager.ExecutionContext.Dispose()
at Hyland.Core.Unity.UnityExecutor.WorkflowExecute(Session session, Int64 operationId, IWorkItemContent content, Element queueElement, PropertyBag sessionPropertyBag, PropertyBag scopedPropertyBag, Int64 batchDocumentsRemaining, Boolean scriptResult)
at Hyland.Core.Workflow.Module.ExecuteUnityScript(Session session, IWorkItemContent item, Int64 batchDocumentsRemaining, Queue queue, UserProperties scopedPropertyBag, Int64 scriptID, Boolean defaultScriptResult)
at Hyland.Core.Workflow.Tasks.Rules.RunUnityScript.ExecutionService.ExecuteImpl(Session session, IWorkItemContent content, Queue queue, ITaskConfiguration configuration, ExecutionArgs args)
at Hyland.Core.Workflow.Tasks.ExecutionServiceBase.Execute(Application app, ExecutionArgs args)
at Hyland.Core.Workflow.Rule.Execute(Session session, IWorkItemContent document, AddInExecutionArgs executionArgs)
Rule: 1400 'SCRIPT: BulkComplete (Unity)'
Type: Sys_RunUnityScript
Data: System.Collections.ListDictionaryInternal
TargetSite: Hyland.Core.Workflow.AddIn.ExecutionResult Execute(Hyland.Core.Session, Hyland.Core.WorkItemContent.IWorkItemContent, Hyland.Core.Workflow.AddInExecutionArgs)
HelpLink: NULL
Source: Hyland.Core.Workflow
StackTrace Information
*********************************************
at Hyland.Core.Workflow.Rule.Execute(Session session, IWorkItemContent document, AddInExecutionArgs executionArgs)
at Hyland.Core.Workflow.TaskExecutorInternal.RuleExecutor.ExecuteOrResume(Rule rule, RuleState ruleState, SuspendedTask resumeTask, AddInExecutionArgs executionArgs)
at Hyland.Core.Workflow.TaskExecutorInternal.RuleExecutor.Execute(Rule rule, TaskExecutorState executorState, AddInExecutionArgs executionArgs)
at Hyland.Core.Workflow.TaskExecutorInternal.TaskListExecutor.ExecuteOrResume(TaskList taskList, TaskListState taskListState, SuspendedTask resumeTask, AddInExecutionArgs executionArgs)
at Hyland.Core.Workflow.TaskExecutorInternal.TaskListExecutor.Execute(TaskList taskList, TaskExecutorState executorState, AddInExecutionArgs executionArgs)
at Hyland.Core.Workflow.TaskExecutor.ExecuteTaskStateStack()
at Hyland.Core.Workflow.TaskExecutor.ExecuteTopLevelTaskListOnCurrentDocument(TaskList taskList)
at Hyland.Core.Workflow.TaskExecutor.ExecuteTaskListsOnContent(IWorkItemContent content)
at Hyland.Core.Workflow.TaskExecutor.ExecuteDocumentList(List`1 documentList, Boolean setBatchDocumentsRemaining)
at Hyland.Core.Workflow.TaskExecutor.HandleExecuteOrResume(TaskExecutorOptions options, SuspendedTask resumeTask)
3) Exception Information
*********************************************
Exception Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Data: System.Collections.ListDictionaryInternal
TargetSite: Void RemoveSession(System.String)
HelpLink: NULL
Source: Hyland.Core.Unity
StackTrace Information
*********************************************
at Hyland.Core.Unity.Services.SessionCache.RemoveSession(String sessionID)
at Hyland.Core.Unity.AppDomainManager.ExecutionContext.Dispose()
at Hyland.Core.Unity.UnityExecutor.WorkflowExecute(Session session, Int64 operationId, IWorkItemContent content, Element queueElement, PropertyBag sessionPropertyBag, PropertyBag scopedPropertyBag, Int64 batchDocumentsRemaining, Boolean scriptResult)
at Hyland.Core.Workflow.Module.ExecuteUnityScript(Session session, IWorkItemContent item, Int64 batchDocumentsRemaining, Queue queue, UserProperties scopedPropertyBag, Int64 scriptID, Boolean defaultScriptResult)
at Hyland.Core.Workflow.Tasks.Rules.RunUnityScript.ExecutionService.ExecuteImpl(Session session, IWorkItemContent content, Queue queue, ITaskConfiguration configuration, ExecutionArgs args)
at Hyland.Core.Workflow.Tasks.ExecutionServiceBase.Execute(Application app, ExecutionArgs args)
at Hyland.Core.Workflow.Rule.Execute(Session session, IWorkItemContent document, AddInExecutionArgs executionArgs)
07-29-2014 10:07 AM
Steven,
When the script is executed, does it transition this document (or another related document) to another workflow lifecycle with a "SYS - Run Unity Script" action? If so, this was fixed in OnBase 12.0.3.241 via SCR 157577.
07-30-2014 07:08 AM
Thanks for the response, Joe. There's not a transition at the end of the script but Hyland support suggested that same SCR might be the culprit. I'm not sure when I will get the chance to upgrade the Timer Service past 12.0.3.241 but I will report back when that happens if that fixes it.
Thanks again for the help.
07-30-2014 08:09 AM
Not a problem, you are welcome!
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.