javax.servlet.ServletException: Error creating bean with name 'mySessionFactory' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/transaction/TransactionManager
这里已经指出错误来了找不到javax/transaction/TransactionManager楼主仔细检查你的class吧

解决方案 »

  1.   

    <property name="mappingDirectoryLocations">
          <list>
            <value>com/gzt/pojo/Userinfo.hbm.xml</value>
          </list>
        </property>
    这里的问题,你用了mappingDirectoryLocations是指定你配置文件的目录,而不是指定具体的文件应该这样配置,如果上面你的目录是对的话
    <property name="mappingDirectoryLocations">
    <list>
    <value>classpath:com/gzt/pojo/</value>
    </list>
    </property>
    或者用另外一种配置方法
    <property name="mappingResources">
    <list>
    <value>classpath:com/gzt/pojo/</value>
    </list>
    </property>
      

  2.   

    上面另一种方法没写完不知道怎么提交了应该是这样写:
    <property name="mappingResources">
    <list>
    <value>Userinfo.hbm.xml</value>
    </list>
    </property>
      

  3.   

    zqpsswh(似水无痕) ( ) 信誉:100    Blog 多谢!你的支持!
    找不到javax/transaction/TransactionManager
    这不是事务关理嘛!我的class里是没有用到呀!不是在配置里配嘛!
      

  4.   

    事务管理可以在配置文件里配置声明的事务管理和通过依赖注入在DAO中使用编码的事务管理。
      

  5.   

    coolboy81() ( ) 信誉:100    Blog 
    多谢!你的支持!
    事务管理可以在配置文件里配置声明的事务管理和通过依赖注入在DAO中使用编码的事务管理。
      我不知道怎样去实现呀!麻烦你讲详细点好嘛!多谢!!我是一个初学者!!
      

  6.   

    ...这个在Spring中文文档里都有说明的,自己去看看吧,不是几句话可以说得清的
      

  7.   

    虽然你未配置事务,但是CLASS要依耐的洒
      

  8.   

    那不是有业务吗?  <bean id="TransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
      <property name="sessionFactory">
      <ref local="mySessionFactory"/>
      </property>
      </bean>
      

  9.   

    http://www.eimhe.com/bbs/adget.php?id=379765美河学习在线——专业视频课程下载基地