<property   name="target"> 
        <ref   local="userDAO"/> 
</property> 
这里事务拦截的是userDAO中的几个方法,但是怎么么有看到你这个userDAO在哪里有配置

解决方案 »

  1.   

    <bean   id="fileDAOProxy" 
        class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> 
            <property   name="transactionManager"> 
    <ref   bean="transactionManager"/> 
    </property> 
    <property   name="target"> 
            <ref   local="userDAO"/> 
    </property> 
    <property   name="transactionAttributes"> 
                <props> 
    <prop   key="create*"> PROPAGATION_REQUIRED </prop> 
    <prop   key="delete*"> PROPAGATION_REQUIRED </prop> 
    <prop   key="edit*"> PROPAGATION_REQUIRED </prop> 
    <prop   key="find*"> PROPAGATION_REQUIRED,readOnly </prop> 
                                                                    <prop   key="save"> PROPAGATION_REQUIRED </prop> 
    </props> 
              </property> 
      </bean> 
    拿这一段做例子,<ref   local="userDAO"/> local是在当前文件中找userDAO这个bean,你的配置文件里根本就没有配置这个,肯定找不到的