Logging Shark internal information in external application
Monique Maker <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.shark |
|---|---|
| Message-ID | <[email protected]> |
Hello list,
We found the following issue with the way Shark handles problems in tool angents.When a (Java) tool throws an exception it provides information (call stack) up to the tool agent - there is no information regarding the tool that was invoked. It would be good if Shak reports (any) exceptions together with the following:
- Process version (not the "load" version, but our own one). This is very important for us because process definitions package management is out of our control and we cannot relate process definition load version (assigned by Shark) to our build version. The version can be also the one of the process definitions package at process start runtime (not the last version, as the running process could be instantiated from an older definition);
- Process Manager ID (to see the process definition package name or ID);
- Process ID (to see the process definition name or ID);
- Activity ID (to see the activity definition name or ID);
(- Tool agent (Java) class name;)
(- Tool agent parameter values.)
The actual exception log reported in deomponstrated below.
We tried to modify JavaClassToolAgent but this requires connecting Shark through the administrative interfaces, but in such a general tool agent the
user & password to connect then cannot be literals. Probably they should be retrieved through the transaction or context.
Here is an example of stack trace on problem deep in the logic our tool calls:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.enhydra.shark.toolagent.JavaClassToolAgent.invokeApplication(JavaClassToolAgent.java:53)
at org.enhydra.shark.toolagent.DefaultToolAgent.invokeApplication(DefaultToolAgent.java:72)
at org.enhydra.shark.ToolAgentManagerImpl$ToolRunner.invokeApplication(ToolAgentManagerImpl.java:211)
at org.enhydra.shark.ToolAgentManagerImpl$ToolRunner.run(ToolAgentManagerImpl.java:96)
at org.enhydra.shark.ToolAgentManagerImpl.executeActivity(ToolAgentManagerImpl.java:67)
at org.enhydra.shark.WfActivityImpl.runTool(WfActivityImpl.java:1269)
at org.enhydra.shark.WfActivityImpl.startActivity(WfActivityImpl.java:1212)
at org.enhydra.shark.WfActivityImpl.activate(WfActivityImpl.java:1157)
at org.enhydra.shark.WfProcessImpl.startActivity(WfProcessImpl.java:816)
at org.enhydra.shark.WfProcessImpl.run(WfProcessImpl.java:695)
at org.enhydra.shark.WfProcessImpl.start(WfProcessImpl.java:365)
at org.enhydra.shark.WfProcessWrapper.start(WfProcessWrapper.java:571)
2 >>> at org.enhydra.shark.WfProcessWrapper.start(WfProcessWrapper.java:531)
1 >>> at net.ifao.vegas.business.workflow.engine.WfProcessBean.startDirect(WfProcessBean.java:337)
at net.ifao.vegas.business.workflow.engine.WfProcessBean_d8q680_ELOImpl.startDirect(WfProcessBean_d8q680_ELOImpl.java:813)
at net.ifao.vegas.business.workflow.engine.jms.CommandStartProcess.execute(CommandStartProcess.java:65)
at net.ifao.vegas.business.workflow.engine.jms.QueueCommandListenerMessageBean.onMessage(QueueCommandListenerMessageBean.java:87)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Caused by: net.ifao.vegas.framework.Failure
at net.ifao.vegas.business.workflow.engine.toolagents.InvokePreviewReportDefinition.execute(InvokePreviewReportDefinition.java:58)
... 28 more
org.enhydra.shark.api.internal.toolagent.ToolAgentGeneralException
at org.enhydra.shark.toolagent.JavaClassToolAgent.invokeApplication(JavaClassToolAgent.java:68)
at org.enhydra.shark.toolagent.DefaultToolAgent.invokeApplication(DefaultToolAgent.java:72)
at org.enhydra.shark.ToolAgentManagerImpl$ToolRunner.invokeApplication(ToolAgentManagerImpl.java:211)
at org.enhydra.shark.ToolAgentManagerImpl$ToolRunner.run(ToolAgentManagerImpl.java:96)
at org.enhydra.shark.ToolAgentManagerImpl.executeActivity(ToolAgentManagerImpl.java:67)
at org.enhydra.shark.WfActivityImpl.runTool(WfActivityImpl.java:1269)
at org.enhydra.shark.WfActivityImpl.startActivity(WfActivityImpl.java:1212)
at org.enhydra.shark.WfActivityImpl.activate(WfActivityImpl.java:1157)
at org.enhydra.shark.WfProcessImpl.startActivity(WfProcessImpl.java:816)
at org.enhydra.shark.WfProcessImpl.run(WfProcessImpl.java:695)
at org.enhydra.shark.WfProcessImpl.start(WfProcessImpl.java:365)
at org.enhydra.shark.WfProcessWrapper.start(WfProcessWrapper.java:571)
at org.enhydra.shark.WfProcessWrapper.start(WfProcessWrapper.java:531)
at net.ifao.vegas.business.workflow.engine.WfProcessBean.startDirect(WfProcessBean.java:337)
at net.ifao.vegas.business.workflow.engine.WfProcessBean_d8q680_ELOImpl.startDirect(WfProcessBean_d8q680_ELOImpl.java:813)
at net.ifao.vegas.business.workflow.engine.jms.CommandStartProcess.execute(CommandStartProcess.java:65)
at net.ifao.vegas.business.workflow.engine.jms.QueueCommandListenerMessageBean.onMessage(QueueCommandListenerMessageBean.java:87)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.enhydra.shark.toolagent.JavaClassToolAgent.invokeApplication(JavaClassToolAgent.java:53)
... 23 more
Caused by: net.ifao.vegas.framework.Failure:
at net.ifao.vegas.business.workflow.engine.toolagents.InvokePreviewReportDefinition.execute(InvokePreviewReportDefinition.java:58)
... 28 more
The last point in our code found in the stack trace (position "1 >>>") executes process.start() (position "2 >>>"). Actually the exception was thrown deep inside the business logic called from the tool, which was called from the tool agent for the first activity in the process. It is obvious that the stack trace is even misleading in this case.
Please advice us how to solve the described situation.
Best Regards,
Monique
message-footer.txt
(text/plain, 271 B)
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws