I integrated Spring Batch Admin into my app, which uses Spring 3.2.
Now I try to annotate a method with @Scheduled
and activate this with <task:annotation-driven/>
.
When I launch the webapp I get this exception:
Caused by: java.lang.IllegalStateException: @Scheduled method 'removeInactiveExecutions'
found on bean target class 'SimpleJobService', but not found in any interface(s) for bean
JDK proxy. Either pull the method up to an interface or switch to subclass (CGLIB) proxies
by setting proxy-target-class/proxyTargetClass attribute to 'true'
The SimpleJobService
of Spring Batch Admin uses this annotation on a method.
In Spring 3.2. it seems, that there is no need to put cglib into the classpath and spring-asm is obsolete, too. I excluded the spring-asm
dependency from spring-batch-integration.
Where can I set proxy-target-class=true
(I already tried it on <tx:annotation-config>
and <aop:config>
?
How can I use @Scheduled
in my application?
<task:scheduled-tasks>
element to create a scheduler on a bean e.g.<task:scheduled ref="jobRunner" method="launchTheJob" cron="0 0 12 * * MON-FRI"/>
. – timomeinen