Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'arithmeticCalculator' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting 'name pattern' at character position 36
execution(*ArithmeticCalculator.add(..))
Caused by: java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting 'name pattern' at character position 36
execution(*ArithmeticCalculator.add(..))
execution(*ArithmeticCalculator.add(..))
Caused by: java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting 'name pattern' at character position 36
execution(*ArithmeticCalculator.add(..))
出错原因:@Before("execution(*ArithmeticCalculator.add(..))")改为:@Before("execution(* ArithmeticCalculator.add(..))")。注意空格!
log4j.properties配置文件
log4j.rootLogger=DEBUG, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
建在src文件夹即可
@DeclareParents(value="cal2.PoCalculatorImpl",defaultImpl=MaxCalculatorImpl.class)
value的包名需要完整写进去,不然会提示转换失败!