https://knowledge.broadcom.com/external/article?articleNumber=390790
When System.setLogMarker is run from an action an exception is thrown, but succeeds when ran from a Workflow
Issue/Introduction
When System.setLogMarker is run from an action an exception is thrown:
Error Message: Action 'TestAction' in module 'com.vmware.library.vra' failed: Wrapped java.lang.ClassCastException: class ch.dunes.scripting.jsmodel.Definitions$2 cannot be cast to class ch.dunes.scripting.server.script.MainScriptingObject (ch.dunes.scripting.jsmodel.Definitions$2 and ch.dunes.scripting.server.script.MainScriptingObject are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader)
Cause
The 'System.setLogMarker' method cannot be called directly from an action
Resolution
If you need to run this method within an action directly, and not through a workflow, surround the method in a try/catch block.
Example:
try{
System.setLogMarker("ACTION: test");
}
catch(e){}
Comments
Post a Comment