<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:aop="http://www.springframework.org/schema/aop"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://www.springframework.org/schema/beans  
   http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 
    http://www.springframework.org/schema/aop 
  http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">  
<!-- Root Context: defines shared resources visible to all other web components -->
<bean id="dao" class="test.spring.dao.impl.UserDaoImpl"/>
    <bean id="service" class="test.spring.service.impl.UserServiceImpl">
      <property name="dao" ref="dao"/> 
       </bean>    
       <bean id="userAction" class="test.spring.action.UserAction">    
       <property name="service" ref="service"/> </bean>
          <bean id="logAspectJ" class="test.spring.aop.LogAspectJ"/>  
               <aop:config>
              <aop:aspect id= "logaop" ref="logAspectJ"> 
              
                 <aop:pointcut id="logpointcut" expression="execution(* test.spring.action.UserAction.*(..))"/> 
                    <aop:before pointcut-ref="logpointcut" method="myBeforeAdvice"/>   
                     <aop:after-returning pointcut-ref="logpointcut"  method="myAfterReturningAdvice"/>  
                       <aop:after-throwing pointcut-ref="logpointcut" method="myAfterThrowingAdvice" throwing="e"/>   
                          <aop:after pointcut-ref="logpointcut" method="myAfterAdvice"/>    
                  <aop:around pointcut-ref="logpointcut" method="myAroundAdvice"/>   
                  </aop:aspect>
</aop:config>
</beans>错误信息如下:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dao' defined in file [E:\Eclipse_workplace\AOP2\src\main\webapp\WEB-INF\spring\root-context.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0': Cannot create inner bean '(inner bean)' of type [org.springframework.aop.aspectj.AspectJMethodBeforeAdvice] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'logpointcut' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logpointcut': Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/BCException