---------------->Spring 中使用Before advice报了一堆错<-----------
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.config.internalAutoProxyCreator':
Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class
[org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator]: Constructor threw exception; nested exception is
java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor
就是这样写的:
package org.spring.test;import org.aspectj.lang.annotation.*;import org.springframework.stereotype.Component;@Aspect@Componentpublic class Log { @Before("execution(public void org.spring.test.UserDAOImpl.save(org.spring.test.User))") public void myLog() { System.out.println("You can do sth before this!!!"); }}