[jboss-user] [EJB3] - Adding @Schedule annotation using AOP is not working

Eman Emanovic do-not-reply at jboss.com
Thu Sep 8 06:19:23 EDT 2011

Eman Emanovic [http://community.jboss.org/people/emanovic] created the discussion

"Adding @Schedule annotation using AOP is not working"

To view the discussion, visit: http://community.jboss.org/message/625459#625459


I already asked this question on AOP forum ( http://community.jboss.org/message/623183#623183 http://community.jboss.org/message/623183#623183). But I am not sure if it is AOP or EJB problem, so I copy it here as well.

I am trying to create schedule event using EJB3.1 @Schedule annotation. Everything works fine as long as I have the annotation inside my bean. I want to be able to change schedule in deployment time without repacking ear. So I want to add this annotation using AOP. But it doesn't work.

Here is my sample bean:

@AspectDomain(value = "TimerBeanDomain") 
*public* *class* TimerBean {

      *public* *void* timerMethod() {   
         System.out.println("Timer method activated");

And here is my aop.xml:

<?xml version="1.0" encoding="UTF-8"?> 

<aop xmlns="urn:jboss:aop-beans:1.0"> 
     <domain name="TimerBeanDomain">  
         <annotation expr="method(void *->timerMethod(..))>   
             @javax.ejb.Schedule(second=*/30, minute=*, hour=*")  

Bean is packed inside -ejb.jar, which is packed in .ear. AOP file is outside ear file.

There are no errors in console. It just does not work.

I tried it with stateless bean as well. In this case aop.xml looked like:
<domain name="TimerBeanDomain" extends="Stateless Bean" inheritBindings="true"> 

I tried JBoss 6.0.1 and JBoss 6.1.0 with same result. 

At least is there some way how to debug AOP process of adding annotation?

Any help will be appreciated.


Reply to this message by going to Community

Start a new discussion in EJB3 at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110908/842a6f9b/attachment-0001.html 

More information about the jboss-user mailing list