@Around建议抛出错误

时间:2013-03-04 21:07:35

标签: spring aspectj spring-aop

我的方面有以下几点。看起来执行模式可能是原因。我希望有人可以帮我找到以下建议的错误。

@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时出错:找不到匹配的工厂方法:factory bean'paymentSystemTestContext';工厂方法'paymentService()'。检查具有指定名称的方法是否存在,并且它是非静态的。

2 个答案:

答案 0 :(得分:1)

而不是切入点模式问题,这似乎是一个错误,其方式是定义了一个Spring bean。您最有可能将bean定义为:

<bean class="com.ss.psystem.conf.PaymentSystemTestContext" factory-method="paymentService" />

检查方法paymentService是否确实static

答案 1 :(得分:0)

我发现了这个问题,实际上问题不在于切入点或任何东西,其中一个bean是不正确的自动装配,因此问题。它固定在我的最后,我可以看到日志。

感谢您查看此问题。

相关问题