at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
原因1:
@Pointcut(value="execution(public * com.meta.dbcenter.application.service.impl.ApplicationServiceImpl.getApplicationById(*))")
public void doGetApplication(){}
@Before("doGetApplication(id)")
public void beforeGetMethod(){
System.out.println("beforeGetMethod()");
}
原因2:
@Pointcut(value="execution(public * com.meta.dbcenter.application.service.impl.ApplicationServiceImpl.getApplicationById(*))")
public void doGetApplication(String id){ // 不需要string id}
@Before("doGetApplication(id)") // 不需要id
public void beforeGetMethod(){
System.out.println("beforeGetMethod()");
}
Multiple annotations found at this line:
- Pointcut is malformed: warning no match for this type name: id [Xlint:invalidAbsoluteTypeName]
- Pointcut is malformed: Pointcut is not well-formed: expecting '(' at character position 0 doGetApplication ^
- Pointcut is malformed: Pointcut is not well-formed: expecting ')' at character position 92 execution(public *
com.meta.dbcenter.application.service.impl.ApplicationServiceImpl.get*(*)&&(id)) ^^
原因1:
@Pointcut(value="execution(public * com.meta.dbcenter.application.service.impl.ApplicationServiceImpl.getApplicationById(*))&&args(id)") //使用args(id)不当
}
异常三:
org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'applicationService' must be of type [com.meta.dbcenter.application.service.impl.ApplicationServiceImpl], but was actually of type [com.sun.proxy.$Proxy7]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:360)
原因1:
使用了jdk的自动动态代理,需要在<aop:aspectj-autoproxy中添加proxy-target-class="true" 如下:
<aop:aspectj-autoproxy proxy-target-class="true"/>