java.lang.IllegalArgumentException: warning no 匹配此类型名称: quer



我的方面是:

@Aspect
@Service
public class MyAspect {
@AfterReturning(value="(execution(* find(..)) )" +
"&& target(com.erp.core.service.IBaseApplicationService) " +
"&& args(queryKey,object,..)")
public void print()
{
System.out.println("find method called");
}

}

AOP 找不到的类型名称位于:

@Transactional(readOnly=true)
public List find(String queryKey, Object[] object) {
return baseRepository.find(queryKey, object);
}

查找是基本方法,因此每当我打开页面时都会调用它。

堆栈跟踪如下:

Caused by: java.lang.IllegalArgumentException: warning no match for this type name: queryKey [Xlint:invalidAbsoluteTypeName]
at org.aspectj.weaver.tools.PointcutParser.parsePointcutExpression(PointcutParser.java:301)
at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpression(AspectJExpressionPointcut.java:195)
at org.springframework.aop.aspectj.AspectJExpressionPointcut.checkReadyToMatch(AspectJExpressionPointcut.java:181)
at org.springframework.aop.aspectj.AspectJExpressionPointcut.getClassFilter(AspectJExpressionPointcut.java:162)
at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:200)
at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:254)
at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:286)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:117)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:87)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1426)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)

它显示与类型名称查询键不匹配

在绑定形式中使用 args 时,需要在方法建议中包含要绑定的参数。
请注意下面的
方法声明

编辑
@AfterReturning(value="(execution(* find(..)) )" +
"&& target(com.erp.core.service.IBaseApplicationService) " +
"&& args(queryKey,object,..)",returning="returnList")
public void **print(String queryKey, Object[] object,List returnList)**
{
System.out.println("find method called");
}

相关内容

  • 没有找到相关文章

最新更新