質問

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