Spring与Hibernate整合报错:unable to get the default bean validation
来源:互联网 发布:linux sort 倒序 编辑:程序博客网 时间:2024/06/05 15:00
解决方法
在hibernate.cfg.xml配置文件中加入以下配置:
<property name="javax.persistence.validation.mode">none</property>
产生原因
配置Spring和Hibernate进行结合的时候版本出现了问题
javax.persistence.validation.mode默认情况下是auto的,就是说如果不设置的话它是会自动去你的classpath下面找一个bean-validation**包,但是找不到,所以beanvalitionFactory错误。
由于javax.persistence.validation.mode的属性值默认是auto,所以会出错。
在hibernate.cfg.xml里将javax.persistence.validation.mode设置为none,就可以避免出错了。
<!-- Disable the BeanValidation --><property name="javax.persistence.validation.mode">none</property>
总结:
Hibernate 3.6以上版本在用junit测试时会提示错误:
Unable to get the default Bean Validation factory
在hibernate.cfg.xml里增加一属性解决:
<property name="javax.persistence.validation.mode">none</property>
0 0
- Spring与Hibernate整合报错:unable to get the default bean validation
- 测试spring和Hibernate的整合,报错: “Unable to get the default Bean Validation”
- spring整合hibernate出现HibernateException: Unable to get the default Bean Validation factory
- hibernate和spring整合:Unable to get the default Bean Validation factory
- spring整合hibernate出现HibernateException: Unable to get the default Bean Validation factory
- 【转】SSH 整合 junit报错 Unable to get the default Bean Validation factory
- Spring整合两大框架beans.xml中报unable to get the default bean Validation factory
- SSH 整合报错处理记录---Unable to get the default Bean Validation factory
- 整合ssh时候报 Unable to get the default Bean Validation factory
- Hibernate异常: Unable to get the default Bean Validation factory
- Unable to get the default Bean Validation
- Unable to get the default Bean Validation
- Unable to get the default Bean Validation
- hibernate 错误:org.hibernate.HibernateException: Unable to get the default Bean Validation factory
- hibernate 错误:org.hibernate.HibernateException: Unable to get the default Bean Validation factory
- hibernate :org.hibernate.HibernateException: Unable to get the default Bean Validation factory
- 【转】hibernate 错误:org.hibernate.HibernateException: Unable to get the default Bean Validation factory
- 1. hibernate 错误:org.hibernate.HibernateException: Unable to get the default Bean Validation factory
- jQuery对象与dom对象的区别
- 逆向工程书目列表
- Unity3D与旋转相关的函数(C#)
- sql语法
- Chapter 2: Variables and Constants
- Spring与Hibernate整合报错:unable to get the default bean validation
- 很好的开源c++库总结
- 坦克游戏的2.0
- github修改用户名
- 数据结构基础概念
- iOS、mac开源项目及库(转载)
- 为什么要用sub main
- MySQL数据库cmd操作基本命令和加载链接
- adb shell root权限