on 08-11-2015 12:13 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.