我之前是用的Spring3+Hibernate5 发现有冲突。

研究后,正确的版本关系是Spring3+Hibernate4

在网上下载Hibernate4的包替换Hibernate5的包 加入lib

然后在配置连接池的时候,需要下载c3p0的jar包

还需要下载org.springframework.orm......jar包


我的配置

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:p="http://www.springframework.org/schema/p"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"xmlns:context="http://www.springframework.org/schema/context"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"><!--加载properties文件--><context:property-placeholder location="WEB-INF/connectFactor.properties"/><!--配置连接池--><bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"><property name="driverClass" value="${jdbc.driver}"/><property name="jdbcUrl" value="${jdbc.url}"/><property name="user" value="${jdbc.user}"/><property name="password" value="${jdbc.password}"/></bean><!--配置Hibernate的相关属性--><bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"><!--配置连接池--><property name="dataSource" ref="dataSource"/><!--配置Hibernate属性--><property name="hibernateProperties"><props><prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop><prop key="show_sql">true</prop><prop key="hibernate.hbm2ddl.auto">update</prop></props></property><!--配置mapping文件--><property name="mappingResources"><list><value>com/mooc/ssh/domain/Product.hbm.xml</value></list></property></bean><!--配置一个Action--><bean id="productAction" class="com.mooc.ssh.action.ProductAction" scope="prototype"><property name="productService" ref="productService"></property></bean><!--配置业务层的类--><bean id="productService" class="com.mooc.ssh.service.ProductService"><property name="productDao" ref="productDao"/></bean><!--配置一个DAO的类--><bean id="productDao" class="com.mooc.ssh.dao.ProductDao"><property name="sessionFactory" ref="sessionFactory"/></bean><!--配置事务管理器--><bean id="txManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"><property name="sessionFactory" ref="sessionFactory"/></bean><!--开启注解事务--><tx:annotation-driven transaction-manager="txManager"/></beans>

在SSH整合过程中:org/hibernate/engine/spi/SharedSessionContractImplementor相关推荐

  1. SSH整合过程中遇到的头秃问题

    若说遇到最头秃的问题是什么,那必然是404 若说遇到最要命的问题是什么,那必然是后台不报错的404 我真的会谢- 好啦,开始啦 问题一 如果struts配置文件中的extends="stru ...

  2. ERP CRM与SCM整合过程中的知识转移

    ERP(Enterprise Resource Planning,企业资源计划).CRM(Customer Relationship Management,客户关系管理).SCM.CRM(Custom ...

  3. ssh整合:spring+springmvc+hibernate

    1 创建maven的web项目 2 补全项目结构 3 补全web.xml <?xml version="1.0" encoding="UTF-8"?> ...

  4. ssh整合(spring+springmvc+hibernate)

    工程目录结构: 配置pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="ht ...

  5. SSH整合教程(struts2+spring3+hibernate3)(含登陆示例)

    准备工作:下载整合过程中需要的包http://115.com/lb/5lbxlk60#lib.rar 115网盘礼包码:5lbxlk60 1.建立web项目 打开MyEclipse,我用的是8.6,项 ...

  6. 基于Myeclipse的三大框架(SSH)整合

    文中主要基于Myeclipse进行配置,配置流程为:Hibernate --> Spring --> 整合 --> struts2 -->整合.注意:在此文中,主要讲述基于注解 ...

  7. SSH框架整合过程(Struts2+Spring+Hibernate)

    (尊重劳动成果,转载请注明出处:http://blog.csdn.NET/qq_25827845/article/details/53929601 冷血之心的博客) 在学习java框架的过程中,我总结 ...

  8. (ssh整合web导出excel)在ssh框架中使用poi正确导出具有比较高级固定格式的excel 整体过程,查询导出前后台下载...

    (一) 接需求  :   需求相关   (贴图 ) 生成三核对文件 1.新增三核对菜单页面中,增加生成三核对文件功能按钮,弹窗可根据变电站.电压等级查询定值单. 2.定值单信息以表格形式展示,根据选择 ...

  9. ssh整合hibernate 使用spring管理hibernate二级缓存,配置hibernate4.0以上二级缓存

    ssh整合hibernate 使用spring管理hibernate二级缓存,配置hibernate4.0以上二级缓存 hibernate  : Hibernate是一个持久层框架,经常访问物理数据库 ...

最新文章

  1. 绘制图形可以使用什么python数据库_用Matplotlib如何绘制3D图形
  2. cytoscape---插件clueGO的使用
  3. jquery封装的ajax请求
  4. 最近在学OpenGL和英语
  5. 【Flutter】Flutter 混合开发 ( Flutter 与 Native 通信 | Android 端实现 BasicMessageChannel 通信 )
  6. 数据结构源码笔记(C语言):索引文件建立和查找
  7. 新疆兵团谋定丰收美景-万祥军:对话农民丰收节交易会
  8. python中使用pickle进行序列化
  9. java -jar命令引导启动Springboot项目的那点事
  10. java需求分析和设计,附面试题
  11. 如果你是测试在职,我给你几条快速成长的建议!供所有做软件测试的参考...
  12. 洛谷——P1009 [NOIP1998 普及组] 阶乘之和
  13. c语言中十进制与十六进制转换_二进制、八进制、十进制、十六进制数据转换...
  14. oracle regexp_instr,Oracle REGEXP_INSTR 用法
  15. eclipse安装Windows Builder
  16. 记一道面试算法题: 某学校需要一个能给学领前儿童自动出三个数加减法的算术题的程序(此处省略一万个字)
  17. 联想电脑G40无法使用 非要睡眠后才能启用wifi
  18. 【Java基础】语法基础
  19. AutoCAD Civil 3D坐标几何(COGO)输入
  20. Spring学习-初识Spring

热门文章

  1. Oracle 表空间信息
  2. 安卓如何限制横屏和竖屏
  3. JAVA数据库连接的另一种实现及简单的数据插入及显示
  4. 避免重蹈欧美“超级电厂”覆辙 瑞星全力保障国内电力行业信息安全
  5. Sylius不需要缓存使用默认地址
  6. 警告:failed to load the sqljdbc_auth.dll cause no sqljdbc_auth in java.library.path
  7. DataTable的AcceptChange方法为什么不能在Update之前?
  8. 机器学习之梯度下降法
  9. Windows下nginx-http-flv-module服务部署
  10. 如何在matlab数组中添加新元素