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

Eman Emanovic do-not-reply at jboss.com
Fri Aug 26 08:48:27 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/623183#623183


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. Because I want to be able to change schedule in deploy 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 JBoss AOP at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110826/910cc25c/attachment-0001.html 

More information about the jboss-user mailing list