解决方案 »

  1.   

    其实异常提示的很清楚了,你发的这个帖子也讲的比较明白!你的CommonDao继承了HibernateDAOSupport,而父类含有final的方法无法被AAOP代理,解决方式可以把HibernateDAOSupport在context里面用Bean配置好,然后作为CommonDao的属性采用@Autowire来试试.
      

  2.   

    确实好了,,,我没有再让  CommonDao 继承 SqlSessionDaoSupport,从而获取,SqlSession,
    <!-- SqlSessionTemplate -->
    <bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate" scope="prototype"> 
                  <constructor-arg index="0" ref="sqlSessionFactory" />  
                    <constructor-arg index="1" value="BATCH" />  <!--  如果想要进行批量操作可加入这个属性 -->
    </bean>
    要配置 scope="prototype"  不然 会抛警告, <WARN> [org.springframework.beans.factory.support.DisposableBeanAdapter (line-337)] - Invocation of destroy method 'close' failed on bean with name 'sqlSession': java.lang.UnsupportedOperationException: Manual close is not allowed over a Spring managed SqlSession(scope="prototype"  是保证他线程安全吗?)CommonDao 注入了一个 sqlSession,public class CommonDao {

           @Resource
    private SqlSession session; // 注入一个session

    public void setSession(SqlSession session) {
    this.session = session;
    }

    public SqlSession getDAO()
    {
    return this.session;
    }

    }错误确实没了,,,万分感谢