문제

I'm trying to call a method in Spring-powered bean asynchronously using @Async. I defined an executor in XML:

<task:executor id="emailTasksExecutor" pool-size="1" />

and here is my method:

@Override
@Async("emailTasksExecutor")
public void sendEmail()
{
    ...
}

And the method does not get called at all when I use qualifier (emailTasksExecutor). However, if I remove it, everything works ok. But in this case the default executor is used and I need to change this behaviour.

I thought the problem is that my class does not implement any interfaces, and something went wrong with proxies. But extracting the interface did not help.

도움이 되었습니까?

해결책

So, the problem was my maven-aspectj-plugin. I found the solution here. All I need to do is to add mode="aspectj" to the task:annotation-driven.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top