Caused by: org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not
来源:互联网 发布:java 秒杀 并发 代码 编辑:程序博客网 时间:2024/06/16 02:49
我手动配置hibernate4.3.4,测试的时候出现:
Caused by: org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set
我是按照官方文档配置的,但是官方文档的代码好像有点问题
这是官方文档里面的那个工具类的部分代码:return new Configuration().configure().buildSessionFactory(
new StandardServiceRegistryBuilder().build() );
搞笑的是,官方文档时没有哪个return,感觉是不是太粗心了
。。。。后来看网上的文档,自己有改了一下,可以了
下面是正确的代码:
Configuration configuration = new Configuration().configure();
ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build();
SessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry);
return sessionFactory;
0 0
- Caused by: org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not
- org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set 解决方法
- org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set
- org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set .
- org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set
- ssh整合Caused by: org.hibernate.HibernateException: 'hibernate.dialect' must be set when no Connection
- hibernate第二篇 org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' no
- Hibernate4后出现: org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect'
- Connection cannot be null when 'hibernate.dialect' not set
- Connection cannot be null when 'hibernate.dialect' not set
- Connection cannot be null when 'hibernate.dialect' not set
- Connection cannot be null when 'hibernate.dialect' not set
- Hibernate Connection cannot be null when 'hibernate.dialect' not set错误
- Exception in thread "main" org.hibernate.HibernateException: Connection cannot be null when 'hiberna
- 正确决解Hibernate4.*中:Connection cannot be null when 'hibernate.dialect' not set
- HIbernate4.2.7错误Connection cannot be null when 'hibernate.dialect' not set
- Connection cannot be null when 'hibernate.dialect' not set问题的解决
- 异常:org.hibernate.HibernateException: 'hibernate.dialect' must be set when no Connection available
- 社区问答专家招奖征资源分享有内涵访顾伟
- 决定踏上程序员之路!
- 时序分析/约束(一):相关概念
- Longest Palindromic Substring
- Linux--linux下常用内核参数
- Caused by: org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not
- JAVA学习之StringBuffer 与Sring类的区别(实例展示)
- mongodb,windows版安装
- 理清udp,tcp 缓存区的
- 数据库安装类故障
- Android开发之Uri、UriMatcher、ContentUris学习
- 串口打印调试信息的延时问题
- static_cast与dynamic_cast
- 主力后卫酒驾重dkfkdsj缘世界杯或危及职业生涯