spring-boot配置Hibernate报异常Could not open Hibernate Session for transaction; nested exception is java.
来源:互联网 发布:java web异步下载文件 编辑:程序博客网 时间:2024/06/05 08:59
import org.springframework.orm.hibernate5.HibernateTransactionManager;import org.springframework.orm.hibernate5.LocalSessionFactoryBean;
@Beanpublic LocalSessionFactoryBean sessionFactory() { LocalSessionFactoryBean sessionFactoryBean = new LocalSessionFactoryBean(); sessionFactoryBean.setDataSource(dataSource()); sessionFactoryBean.setPackagesToScan(ENTITYMANAGER_PACKAGES_TO_SCAN); Properties hibernateProperties = new Properties(); hibernateProperties.put("hibernate.dialect", HIBERNATE_DIALECT); hibernateProperties.put("hibernate.show_sql", HIBERNATE_SHOW_SQL); hibernateProperties.put("hibernate.hbm2ddl.auto", HIBERNATE_HBM2DDL_AUTO); sessionFactoryBean.setHibernateProperties(hibernateProperties); return sessionFactoryBean;}
原因:导入的hibernate的包是5.0的, org/hibernate/engine/transaction/spi/TransactionContext这个类已经移除了,所以导入hibernate5内的包
0 0
- spring-boot配置Hibernate报异常Could not open Hibernate Session for transaction; nested exception is java.
- 解决Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassDefFoundEr
- 解决Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassDefFoundErr
- could not open hibernate session for transaction; nested exception is org.hibernate.exception.generi
- Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.Generi
- Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionExcep
- Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionExcep
- Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionExcep
- Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionExce
- HTTP Status 500 - Could not open Hibernate Session for transaction; nested exception is org.hibernat
- Could not open Hibernate Session for transaction; nested exception is.....远程服务器部署后出现这个问题分析
- Could not open Hibernate Session for transaction
- Could not open Hibernate Session for transaction
- Could not open Hibernate Session for transaction
- Could not open Hibernate Session for transaction
- Could not open Hibernate Session for transaction
- Could not open Hibernate Session for transaction;
- Could not open Hibernate Session for transaction
- [CSS]滚动条
- ORACLE百万记录SQL语句优化技巧
- android 4.2中如何修改默认语言和国家.
- 部分和问题
- 非Nginx 来配置https访问
- spring-boot配置Hibernate报异常Could not open Hibernate Session for transaction; nested exception is java.
- js 进行数字运算
- 学习文本分类(一) 补充1
- jdk配置失败
- ser2net的双向通信
- Caffe2简介
- 二叉树的多种 顺序遍历
- 用插件完美解决百度云下载限制
- lintcode子树