Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
7.0.3
-
None
Description
In a very simple application there are one stateless EJB with timers and one stateful without timers. Both are injected in a servlet. When from the stateless EJB TimerService.getAllTimers() is called, an IllegalStateException is thrown:
java.lang.IllegalStateException: This ejb does not support timers StatefulWithoutTimers org.apache.openejb.core.timer.Timers.getTimerService(Timers.java:74) org.apache.openejb.core.timer.Timers.all(Timers.java:59) org.apache.openejb.core.timer.TimerServiceWrapper.getAllTimers(TimerServiceWrapper.java:55) my.test.beans.StatelessWithTimers.getAllTimers(StatelessWithTimers.java:25) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:205) org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:186) org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:181) org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:100) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:205) org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:186) org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:85) org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:252) org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:212) org.apache.openejb.core.ivm.EjbObjectProxyHandler.synchronizedBusinessMethod(EjbObjectProxyHandler.java:265) org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:260) org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:89) org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:347) my.test.beans.StatelessWithTimers$$LocalBeanProxy.getAllTimers(my/test/beans/StatelessWithTimers.java) my.test.TimersTest.doGet(TimersTest.java:29) javax.servlet.http.HttpServlet.service(HttpServlet.java:622) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
According to the EJB 3.2 specification, the TimerService.getAllTimers() method should return active timers associated with the beans in the same module in which the caller bean is packaged. No such exception is expected if there is a bean without timers.
This problem can be reproduced with this application
The request path is /TestTimers/TimersTest