在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是一个持久层框架,经常访问物理数据库 ...
最新文章
- JavaScript初学者编程题(8)
- 10. JavaScript学习笔记——JSON
- Avalon-MM 阿窝龙妹妹应用笔记
- python之torchlight使用_python游戏编程之pgzero使用介绍
- 交换数组中的两个元素
- 获取ajax传过来的数据_大数据编辑问题
- python后端需要什么基础_【后端开发】python爬虫需要什么基础
- 【数据库系统】DBMS、DBS、DBA、DB的区别
- 第14天:逻辑运算符、if、for语句
- 【原】linux下tar解压缩问题:time stamp in the future
- ORBSLAM关键帧的筛选和插入
- 基于HBR的云上统一备份最佳实践
- 超硬核Java工程师秋招回忆录+面经汇总,为了拿BAT的研发offer我都做了那些准备?
- matlab fftshift函数,matlab fft fftshift--【转帖】
- MAX30102学习笔记(上)
- VSCODE设置绿豆沙主题
- sin1用计算机怎么算,sin1等于多少?
- APP推广前,你应该知道的事
- UnsupportedOperationException:setProperty must be overridden by all subclasses of SOAPMessage解决方法有效
- 苹果和android充电线一根,非常实用!一根充电线,同时搞定苹果、安卓、Type-c,出门带它就够了...