cancel
Showing results for 
Search instead for 
Did you mean: 

Exception cancelling EJBTimer

Former Member
0 Kudos

Hi.

I have a JMX enabled class (deployed through Spring).

It controls the ejb3 Timer object for my application.

Whenever I try to get a list of timers, it generates the following error:

java.lang.IllegalStateException: EnterpriseBeanContext of ComponentExecutionContext com.sap.engine.services.connector.jca.ComponentExecutionContextImpl@ee920 is null.

at com.sap.engine.services.ejb3.runtime.TimerServicesAccessController.getCurrentComponent(TimerServicesAccessController.java:43)

at com.sap.engine.services.ejb3.runtime.impl.DefaultTimerService.getTimers(DefaultTimerService.java:84)

Any ideas?

Andrew

Accepted Solutions (1)

Accepted Solutions (1)

Vlado
Advisor
Advisor
0 Kudos

The TimerService.getTimers() method can be called only by an EJB or on behalf of an EJB whose timers are queried for. Check the [javadoc|http://java.sun.com/javaee/5/docs/api/javax/ejb/TimerService.html#getTimers()].

In your case it seems that the currently executing component in the thread is not an EJB.

HTH!

-- Vladimir

Former Member
0 Kudos

Vladimir,

Thanks for the answer!!

I changed it to be a stateless session bean, but now I get the following error - am i right in thinking that this is talking about a state of transactions

Bean instance is not allowed to call methods of the javax.ejb.TimerService interface.

Basically, I have an ejb, which calls the method on another ejb, which attempts to invoke the TimerService methods.

Regards,

Andrew

Vlado
Advisor
Advisor
0 Kudos

No, this is about the state in the lifecycle of the EJB. Please refer to table 2 in section 4.5.2 of the EJB 3.0 spec for the methods in which a SLSB can access the TimerService.

Note also that in the scenario you described it will be the timers of the second EJB that you'll get, not of the "wrapper" EJB. Unless you call the method on the second EJB class directly, i.e. not on its business interface, in which case it's not an EJB call but a plain Java method call and access to the TimerService is determined by the state (method called) on the "wrapper" EJB.

HTH!

-- Vladimir

Answers (0)