gpt4 book ai didi

java.lang.IllegalArgumentException : warning no match for this type name: queryKey [Xlint:invalidAbsoluteTypeName]

转载 作者:行者123 更新时间:2023-11-30 02:01:44 28 4
gpt4 key购买 nike

我的方面是:

@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);
}

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

堆栈跟踪如下:

 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)

显示类型名称queryKey不匹配

最佳答案

当您在绑定(bind)表单中使用args时,您需要在方法建议中包含要绑定(bind)的参数。
请注意下面的方法声明
编辑

@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");
}

关于java.lang.IllegalArgumentException : warning no match for this type name: queryKey [Xlint:invalidAbsoluteTypeName],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52639605/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com