[jboss-user] [EJB 3.0] - <timeout-method> in ejb-jar.xml is supported in ebj3 RC9?

goldfrog do-not-reply at jboss.com
Wed Dec 13 05:31:46 EST 2006


I wrote a stateless session bean with timeservice. i don't want to  use annonation @Timeout, so how can i define some timeout method in ejb-jar.xml?
i followed the ejb3 core specification and  some examples in  Mastering Enterprise JavaBeans? 3.0. 
i added the following lines for the SLSB in ejb-jar.xml
<timeout-method>
	<method-name>ejbTimeout</method-name>
	<method-params>
		<method-param>javax.ejb.Timer</method-param>
	</method-params>
</timeout-method>

the timeout method defined in my SLSB(without @Timeout annotation) :
public void ejbTimeout(Timer timer) {
      ......
}

the deployments runs fine, and i successfully create a timer for the SLSB 
but after a little while when the timeout method should be called, i receive an EJBException in console: 

javax.ejb.EJBException: No method has been annotated with @Timeout

if i add @Timeout for the  ejbTimeout(Timer timer) or make my Stateless Session Bean class implement javax.ejb.TimedObject , the EJBException disappears, ejbTimeout(Timer timer)  is called and everything is ok.

My Environments JBoss 4.0.5.G.A JBoss EJB3 RC9
I want to know wether there is anything wrong for my code or ejb-jar.xml or just current ejb3 implementation does not support <timeout-method> now.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993327#3993327

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993327



More information about the jboss-user mailing list