Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

error while trying to access the event:while trying to invoke the method com.redwood.scheduler.api.model.event defintion.clear() of a null object loaded from local variable

I am using the below code to get the event and then clear it but it's working for some of the event and for the other it's giving below error. { EventDefinition ed1 = jcsSession.getEventDefinitionByName(Event_Name); {         ed1.clear();      jcsSession.persist();      jcsOut.println(ed1.getName());        jcsOut.println(ed1.getName() + "Events Cleared"); } }

Caused by: java.lang.NullPointerException: while trying to invoke the method com.redwood.scheduler.api.model.EventDefinition.clear() of a null object loaded from local variable 'ed1' at com.redwood.scheduler.custom.JD_CLEAR_EVENT_MGexecute(JD_CLEAR_EVENT_MG.java:user code 7) at com.redwood.scheduler.custom.JD_CLEAR_EVENT_MGStub.jcsExecute(JD_CLEAR_EVENT_MGStub.java:30) ... 13 more

Tags:
replied

Hello,

In that case the Event_Name event definition does not exist. Is your event in a Partition that is not GLOBAL? In that case you have to specify the partition as well.

EventDefinition ed = jcsSession.getEventDefinitionByName(jcsSession.getPartitionByName("<partition name>"), Event_Name);

Regards Gerben

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question