When System.setLogMarker is run from an action an exception is thrown, but succeeds when ran from a Workflow
search cancel

When System.setLogMarker is run from an action an exception is thrown, but succeeds when ran from a Workflow

book

Article ID: 390790

calendar_today

Updated On:

Products

VCF Operations/Automation (formerly VMware Aria Suite)

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){}