Caused by: org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set
docs.jboss.org文档示例代码:(http://docs.jboss.org/hibernate/annotations/3.5/reference/en/html_single/)
static {
try {
sessionFactory = new AnnotationConfiguration()
.configure().buildSessionFactory();
} catch (Throwable ex) {
// Log exception!
throw new ExceptionInInitializerError(ex);
}
}
测试时出现Caused by: org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set
自己依赖的是hibernate-core-4.2.7.Final.jar
改成:
Configuration cfg = new Configuration().configure();
ServiceRegistry serviceRegistry= new ServiceRegistryBuilder().applySettings(cfg.getProperties()).buildServiceRegistry();
sessionFactory = cfg.buildSessionFactory(serviceRegistry);
Hibernate官网上没找到说明。网上找的。
Caused by: org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set的更多相关文章
- Connection cannot be null when 'hibernate.dialect' not set
严重: Exception sending context initialized event to listener instance of class [org.springframework.w ...
- org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFacto ...
- Invocation of init method failed; nested exception is org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.impl
严重: Exception sending context initialized event to listener instance of class org.springframework.we ...
- 正确决解Hibernate4.*中:Connection cannot be null when 'hibernate.dialect' not set
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hi ...
- Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.cache.ehcache.EhCacheRegionFactory] as strategy [org.hibernate.cache.spi.RegionFac
警告: Exception encountered during context initialization - cancelling refresh attempt: org.springfram ...
- Hibernate(三): org.hibernate.HibernateException: No CurrentSessionContext configured!
Hibernate版本5.2.9 获取Session的方式是sessionFactory.getCurrentSession(); 比较老一些的版本使用的是sessionFactory.openSes ...
- hibernate报错org.hibernate.HibernateException: No CurrentSessionContext configured!
org.hibernate.HibernateException: No CurrentSessionContext configured! at org.hibernate.internal.Ses ...
- Caused by:org.hibernate.HibernateException:Unable to make JDBC Connection
1.错误描述 Caused by:org.hibernate.HibernateException:Unable to make JDBC Connection[jdbc\:mysql\://loca ...
- Caused by: org.hibernate.HibernateException: identifier of an instance of ... is alterde from
Caused by: org.hibernate.HibernateException: identifier of an instance of ... is alterde from Hi ...
随机推荐
- Kafka+Storm+HDFS整合实践
在基于Hadoop平台的很多应用场景中,我们需要对数据进行离线和实时分析,离线分析可以很容易地借助于Hive来实现统计分析,但是对于实时的需求Hive就不合适了.实时应用场景可以使用Storm,它是一 ...
- Linux启动时卡住
该系统本是oracle rac的测试环境,在删除oracle软件后重启时系统卡住(没有按照oracle官方要求删除oracle软件).如下图: 处理过程: 1.使用单用户模式登陆 先在GRUB启动菜单 ...
- update kernel
1,version 2,command First, verify the current kernel version: $ uname -r 2.6.32-358.el6.x86_64 Befor ...
- 试用windows Azure
试用windows Azure, 需要国外手机注册,信用卡注册. windows操作系统,只有2008R2,2012,2012R2可以选择,我选择XS最低档,然后选2012R2,欧洲数据中心,那个慢啊 ...
- 学习OpenCV——OpenMP
转自:http://www.cnblogs.com/yangyangcv/archive/2012/03/23/2413335.html openMP的一点使用经验 最近在看多核编程.简单来说,由 ...
- UVa10023手动开大数平方算法
题目链接:UVa 10023 import java.math.BigInteger; import java.util.Scanner; public class Main { public sta ...
- C# Winform 水波纹效果
//添加自定义控件 using System; using System.Collections.Generic; using System.ComponentModel; using System. ...
- UIMenuController和UIMenuItem的使用
UIMenuController的方法: 1.创建menucontroller + (UIMenuController *)sharedMenuController; 2.设置是否可见 - (void ...
- each实现原理
<script> function isEach(arr, callback) { for (var i in arr) { callback(i, arr[i]); } }; funct ...
- android中的权限(转)
Android权限系统非常庞大,我们在Android系统中做任何操作都需要首先获取Android系统权限,本文记录了所有的Android权限问题,整理一下分享给大家. 访问登记属性 android.p ...