Error applying BeanValidation relational constraints错误的解决

错误示例:
Exception in thread "main" org.hibernate.HibernateException: Error applying BeanValidation relational constraints
at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.applyRelationalConstraints(BeanValidationIntegrator.java:219)
at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:126)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:303)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1750)
at cn.com.zyx.model.StudentTest.main(StudentTest.java:20)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.applyRelationalConstraints(BeanValidationIntegrator.java:208)
... 4 more
Caused by: org.hibernate.HibernateException: Unable to build the default ValidatorFactory
at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:524)
at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(TypeSafeActivator.java:119)
... 9 more
Caused by: javax.validation.ValidationException: Unable to instantiate Configuration.
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:272)
at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:111)
at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:521)
... 10 more
在hibernate.hbm.xml中加上
<property name="javax.persistence.validation.mode">none</property>
javax.persistence.validation.mode默认情况下是auto的,就是说如果不设置的话它是会自动去你的classpath下面找一个bean-validation**包,但是找不到,所以beanvalitionFactory错误

转载于:https://www.cnblogs.com/WenbinChen/p/4322065.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/420146.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

前端学习(1387):多人管理项目7登录 数据库连接

blog.js const express require(express); //创建网站服务器 const app express(); //开放静态资源文件 const path require(path); require(./model/connect)//告诉express框架模板所在的位置 app.set(views, path.join(__dirname, views)); //告诉express框架模板的后缀是…

mysql教程丿it教程网_MySQL整体

整体大纲数据库实现数据持久化使用完整的管理系统统一管理&#xff0c;易于查询数据库的相关概念DB&#xff1a;数据库(database)&#xff1a;存储数据的“仓库”。它保存了一系列有组织的数据。DBMS数据库管理系统(Database Management System)。数据库是通过DBMS创建和操作的…

前端学习(1388):多人管理项目8user登录

blog.js const express require(express); //创建网站服务器 const app express(); //开放静态资源文件 const path require(path); require(./model/connect)//告诉express框架模板所在的位置 app.set(views, path.join(__dirname, views)); //告诉express框架模板的后缀是…

java 通用分页_一个通用的Java分页基类代码详解

分页的基类import java.util.List;/*** 分页显示的标准类,基本操作,是先给予-当前页数一共的数据条数-每页显示的条数,* 然后在初始化该类,得到总共页数,和开始序号和结束序号,* 然后数据库分页用到开始序号和结束序号,得到数据集合后赋值给该类的list属性,** 然后把该类发送到…

前端学习(1364):学生档案信息管理6

service.js //引入http模块 const http require(http); //创建网站服务器 const app http.createServer();const template require(art-template); const path require(path); const serveStatic require(serve-static);//静态资源服务 const serve serveStatic(path.jo…

lua元表(简单例子)

Set {} Set.mt {}--定义普通的表作为元表&#xff0c;为了避免命名污染直接放在Set内部 function Set.new(t)local set {}setmetatable(set, Set.mt)--一组相关的表共享一个metatable(通过这个可以描述他们共同的行为)&#xff0c;一个表也可以是自身的metatable(描述私有行…

java windows7 环境变量_Windows7环境变量中,系统变量与用户变量的优先级

就我理解&#xff0c;不存在先后区别。因为系统变量和用户变量完全不是一回事情&#xff0c;因此某个用户登录他的账户&#xff0c;并且启用了用户变量&#xff0c;那么它会先检查用户变量&#xff0c;如果没有检查到就检查系统变量&#xff0c;都没有则报错。如果按照这样的理…

前端学习(1389):多人管理项目9登录功能具体实现

blog.js const express require(express); //创建网站服务器 const app express(); //开放静态资源文件 const path require(path); require(./model/connect)//告诉express框架模板所在的位置 app.set(views, path.join(__dirname, views)); //告诉express框架模板的后缀是…

英语常见介词错误用法,你有犯过吗?

英语常见介词错误用法&#xff0c;你有犯过吗&#xff1f; 1:错:come to here. 对:come here. 过来。here ,there,home之类的副词&#xff0c;前面不用介词in ,at,(但可以加from,比如from home,from here),直接跟在动词come 后面就可以了。2:错:look at the mirror. 对:look in…

java弹出提示窗口_Java实现弹窗效果的基本操作(2)

本文为大家分享了Java实现弹窗效果的实现代码&#xff0c;供大家参考&#xff0c;具体内容如下1、任务简介我在5月23日写过一篇文章为《Java弹窗操作》&#xff0c;从目前来看浏览量不错&#xff0c;故我将之前省略了的两个程序分享出来&#xff0c;同时也将更多的方法分享出来…

前端学习(1390):多人管理项目10服务器认证

blog.js const express require(express); //创建网站服务器 const app express(); //开放静态资源文件 const path require(path); require(./model/connect)//告诉express框架模板所在的位置 app.set(views, path.join(__dirname, views)); //告诉express框架模板的后缀是…

C# 控制台或者winform程序开启http的监听状态

1 public class THttpListener2 {3 HttpListener listerner;4 /// <summary>5 /// 6 /// </summary>7 /// <param name"prefixes">格式 http://*/test/ </param>8 /// <param name&…

前端学习(1391):多人管理项目11邮箱地址查询信息

blog.js //管理页面 //展示页面 const express require(express);const admin express.Router();admin.get(/login, (req, res) > {res.render(admin/login) }); admin.get(/user, (req, res) > {res.render(admin/user) }); admin.post(/login, async(req, res) >…

java tea属于红茶吗_什么茶属于红茶类

茶叶在中国的历史已经非常悠久了。相信很多人都喝过红茶&#xff0c;红茶种类还是比较多的&#xff0c;那么知道什么茶属于红茶类吗&#xff1f;平时买回来的红茶该怎么保存比较好呢&#xff1f;什么茶属于红茶类 1、中国的红茶种类还是比较多的。其中滇红&#xff0c;祁红&…

前端学习(1392):多人管理项目12加密

blog.js //管理页面 //展示页面 const express require(express);const admin express.Router();admin.get(/login, (req, res) > {res.render(admin/login) }); admin.get(/user, (req, res) > {res.render(admin/user) }); admin.post(/login, async(req, res) >…

【c++ primer读书笔记】【第2章】变量和基本类型

1、 无符号类型 含有无符号类型的表达式&#xff0c;当一个算式表达式中既有unsigned int&#xff0c;又有int时&#xff0c;int会转化为unsigned int&#xff0c; 如int a-1&#xff0c;unsigned b1&#xff0c;则在我的机器中a*b4294967295。 无符号数不会小于0也关系到循环…

java 注入 循环_spring依赖注入——循环依赖

上一篇博客简单地分析了下依赖注入。但是对于依赖注入的很多细节&#xff0c;都没有深入的分析。这一篇博客会继续分析spring的依赖注入。这篇博客会解决分析getBean缓存时候遗留下来的循环依赖问题。循环依赖分析首先明确下&#xff0c;只有单例情况下&#xff0c;spring才会试…

前端学习(1393):多人管理项目13加密实现

blog.js //管理页面 //展示页面 const express require(express);const admin express.Router();admin.get(/login, (req, res) > {res.render(admin/login) }); admin.get(/user, (req, res) > {res.render(admin/user) }); admin.post(/login, async(req, res) >…

Python的逻辑运算符and小析

近期突然对验证码的识别感兴趣了,然后就研究了一些图像识别和处理的资料,其中有一种图像处理是关于字体的细化和骨架提取的,但是这种算法没有现成的java代码实现,那些号称的java版代码多半都是效果很差或是根本不行的..搜索的途中看到一个用python实现的细化提骨架算法,效果很不…

java二叉树的深度_java 二叉树的最大深度

二叉树的最大深度Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Note: A leaf is a node with no children.Example:Given binary tree [3,9,20,null,nul…