Spring @关于抛出错误的建议
我有以下几点。看来行刑方式可能是原因。我希望有人能帮我找出以下建议的错误Spring @关于抛出错误的建议,spring,aspectj,spring-aop,Spring,Aspectj,Spring Aop,我有以下几点。看来行刑方式可能是原因。我希望有人能帮我找出以下建议的错误 @Around(value = "execution(* com.ss.psystem..*.*(..))") public final Object logAround(final ProceedingJoinPoint joinPoint) throws Throwable { Signature signature = joinPoint.get
@Around(value = "execution(* com.ss.psystem..*.*(..))")
public final Object logAround(final ProceedingJoinPoint joinPoint)
throws Throwable {
Signature signature = joinPoint.getSignature();
LOGGER.trace("[{}][{}], Entering method...",
signature.getDeclaringTypeName(), signature.getName());
LOGGER.trace("arguments: {}", Arrays.toString(joinPoint.getArgs()));
Object result = joinPoint.proceed();
LOGGER.trace("[{}][{}], Exit the method.",
signature.getDeclaringTypeName(), signature.getName());
LOGGER.trace("returned value: [{}]", result);
return result;
}
错误:创建在类com.ss.psystem.conf.PaymentSystemTestContext中定义的名为“paymentService”的bean时出错:未找到匹配的工厂方法:工厂bean“PaymentSystemTestContext”;工厂方法“paymentService()”。检查具有指定名称的方法是否存在,以及该方法是否是非静态的。这不是切入点模式问题,而是定义一个
Spring
bean的方式出现错误。您很可能有一个bean定义为:
<bean class="com.ss.psystem.conf.PaymentSystemTestContext" factory-method="paymentService" />
检查方法
paymentService
是否确实是static
我发现了问题,实际上问题不在于切入点或任何东西,其中一个bean未正确自动连接,因此出现了问题。它固定在我这边,我可以看到日志
感谢您关注此问题。@srisris-如果它解决了您的问题,请将此标记为答案。