在SSH整合过程中:org/hibernate/engine/spi/SharedSessionContractImplementor
我之前是用的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相关推荐
- SSH整合过程中遇到的头秃问题
若说遇到最头秃的问题是什么,那必然是404 若说遇到最要命的问题是什么,那必然是后台不报错的404 我真的会谢- 好啦,开始啦 问题一 如果struts配置文件中的extends="stru ...
- ERP CRM与SCM整合过程中的知识转移
ERP(Enterprise Resource Planning,企业资源计划).CRM(Customer Relationship Management,客户关系管理).SCM.CRM(Custom ...
- ssh整合:spring+springmvc+hibernate
1 创建maven的web项目 2 补全项目结构 3 补全web.xml <?xml version="1.0" encoding="UTF-8"?> ...
- ssh整合(spring+springmvc+hibernate)
工程目录结构: 配置pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="ht ...
- SSH整合教程(struts2+spring3+hibernate3)(含登陆示例)
准备工作:下载整合过程中需要的包http://115.com/lb/5lbxlk60#lib.rar 115网盘礼包码:5lbxlk60 1.建立web项目 打开MyEclipse,我用的是8.6,项 ...
- 基于Myeclipse的三大框架(SSH)整合
文中主要基于Myeclipse进行配置,配置流程为:Hibernate --> Spring --> 整合 --> struts2 -->整合.注意:在此文中,主要讲述基于注解 ...
- SSH框架整合过程(Struts2+Spring+Hibernate)
(尊重劳动成果,转载请注明出处:http://blog.csdn.NET/qq_25827845/article/details/53929601 冷血之心的博客) 在学习java框架的过程中,我总结 ...
- (ssh整合web导出excel)在ssh框架中使用poi正确导出具有比较高级固定格式的excel 整体过程,查询导出前后台下载...
(一) 接需求 : 需求相关 (贴图 ) 生成三核对文件 1.新增三核对菜单页面中,增加生成三核对文件功能按钮,弹窗可根据变电站.电压等级查询定值单. 2.定值单信息以表格形式展示,根据选择 ...
- ssh整合hibernate 使用spring管理hibernate二级缓存,配置hibernate4.0以上二级缓存
ssh整合hibernate 使用spring管理hibernate二级缓存,配置hibernate4.0以上二级缓存 hibernate : Hibernate是一个持久层框架,经常访问物理数据库 ...
最新文章
- 绘制图形可以使用什么python数据库_用Matplotlib如何绘制3D图形
- cytoscape---插件clueGO的使用
- jquery封装的ajax请求
- 最近在学OpenGL和英语
- 【Flutter】Flutter 混合开发 ( Flutter 与 Native 通信 | Android 端实现 BasicMessageChannel 通信 )
- 数据结构源码笔记(C语言):索引文件建立和查找
- 新疆兵团谋定丰收美景-万祥军:对话农民丰收节交易会
- python中使用pickle进行序列化
- java -jar命令引导启动Springboot项目的那点事
- java需求分析和设计,附面试题
- 如果你是测试在职,我给你几条快速成长的建议!供所有做软件测试的参考...
- 洛谷——P1009 [NOIP1998 普及组] 阶乘之和
- c语言中十进制与十六进制转换_二进制、八进制、十进制、十六进制数据转换...
- oracle regexp_instr,Oracle REGEXP_INSTR 用法
- eclipse安装Windows Builder
- 记一道面试算法题: 某学校需要一个能给学领前儿童自动出三个数加减法的算术题的程序(此处省略一万个字)
- 联想电脑G40无法使用 非要睡眠后才能启用wifi
- 【Java基础】语法基础
- AutoCAD Civil 3D坐标几何(COGO)输入
- Spring学习-初识Spring
热门文章
- Oracle 表空间信息
- 安卓如何限制横屏和竖屏
- JAVA数据库连接的另一种实现及简单的数据插入及显示
- 避免重蹈欧美“超级电厂”覆辙 瑞星全力保障国内电力行业信息安全
- Sylius不需要缓存使用默认地址
- 警告:failed to load the sqljdbc_auth.dll cause no sqljdbc_auth in java.library.path
- DataTable的AcceptChange方法为什么不能在Update之前?
- 机器学习之梯度下降法
- Windows下nginx-http-flv-module服务部署
- 如何在matlab数组中添加新元素