带有javax.inject.Provider的AOP给出错误

时间:2018-10-01 20:02:47

标签: java spring-aop

我的bean被声明为:

<bean id="dbResponseProvider" class="x.y.z.DbResponse" scope="prototype"/>

它的引用方式如下:

@Resource(name = "dbResponseProvider")
private Provider<ExistingResponse> dbResponseProvider;

类本身的声明类似于

public class DbResponse implements ExistingResponse {
...

我收到以下错误:

Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'dbResponseProvider' is expected to be of type 'javax.inject.Provider' but was actually of type 'com.sun.proxy.$Proxy110'

我的AOP切入点为:

@Around("execution(* x.y.z..*.*(..))" )

是否可以将AOP与javax.inject.Provider一起使用?

0 个答案:

没有答案