Hibernate异常: Unable to get the default Bean Validation factory
2016-11-15 21:14
555 查看
项目原本是部署在Tomcat下没有问题的,改为TongWeb6.1就报如下错误(截取部分),而且TongWeb6.0也是没有问题的。
解决方法是在hibernate.cfg.xml配置文件中 或许名称不一定叫这个 但是在配置sessionFactory的bean节点下
加上如下属性:
上下文:
作者:itmyhome
Caused by: org.hibernate.HibernateException: Unable to get the default Bean Validation factory at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:127) at org.hibernate.cfg.Configuration.applyBeanValidationConstraintsOnDDL(Configuration.java:1677) at org.hibernate.cfg.Configuration.applyConstraintsToDDL(Configuration.java:1627) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1418) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1348) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:717) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:188) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods (AbstractAutowireCapableBeanFactory.java:1514) (AbstractAutowireCapableBeanFactory.java:1452)
解决方法是在hibernate.cfg.xml配置文件中 或许名称不一定叫这个 但是在配置sessionFactory的bean节点下
加上如下属性:
<prop key="javax.persistence.validation.mode">none</prop>
上下文:
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="oracledataSource"/> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.cache.use_second_level_cache">true</prop> <prop key="javax.persistence.validation.mode">none</prop> </props> </property> </bean>
作者:itmyhome
相关文章推荐
- 异常解决—org.hibernate.HibernateException: Unable to get the default Bean Validation factory
- hibernat异常:Unable to get the default Bean Validation factory
- 【转】hibernate 错误:org.hibernate.HibernateException: Unable to get the default Bean Validation factory
- hibernat异常:Unable to get the default Bean Validation factory
- 1. hibernate 错误:org.hibernate.HibernateException: Unable to get the default Bean Validation factory
- 初始化时遇到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
- org.hibernate.HibernateException: Unable to get the default Bean Validation factory
- hibernate :org.hibernate.HibernateException: Unable to get the default Bean Validation factory
- hibernate3.6:Unable to get the default Bean Validation factory
- hibernate和spring整合: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
- spring整合hibernate出现HibernateException: Unable to get the default Bean Validation factory
- org.hibernate.HibernateException: Unable to get the default Bean Validation factory
- org.hibernate.HibernateException: Unable to get the default Bean Validation factory
- hibernat异常: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