javax.validation.ValidationException: Unable to create a Configuration, because no Bean Validation provider could be found

1 org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0‘: Invocation of init method failed; nested exception is javax.validation.ValidationException: Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
  2 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
  3 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
  4 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
  5 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
  6 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
  7 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
  8 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
  9 at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
 10 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
 11 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
 12 at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
 13 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
 14 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
 15 at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
 16 at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
 17 at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
 18 at javax.servlet.GenericServlet.init(GenericServlet.java:158)
 19 at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1231)
 20 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)
 21 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1031)
 22 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4914)
 23 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5201)
 24 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 25 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
 26 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
 27 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
 28 at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1101)
 29 at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1786)
 30 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
 31 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
 32 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 33 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 34 at java.lang.Thread.run(Thread.java:744)
 35 Caused by: javax.validation.ValidationException: Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
 36 at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:271)
 37 at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:184)
 38 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
 39 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
 40 ... 32 more
 41 七月 18, 2015 2:18:16 下午 org.apache.catalina.core.StandardContext loadOnStartup
 42 严重: Servlet [spring] in web application [/Purchase] threw load() exception
 43 javax.validation.ValidationException: Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
 44 at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:271)
 45 at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:184)
 46 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
 47 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
 48 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
 49 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
 50 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
 51 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
 52 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
 53 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
 54 at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
 55 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
 56 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
 57 at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
 58 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
 59 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
 60 at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
 61 at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
 62 at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
 63 at javax.servlet.GenericServlet.init(GenericServlet.java:158)
 64 at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1231)
 65 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)
 66 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1031)
 67 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4914)
 68 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5201)
 69 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 70 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
 71 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
 72 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
 73 at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1101)
 74 at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1786)
 75 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
 76 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
 77 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 78 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 79 at java.lang.Thread.run(Thread.java:744)
 80 七月 18, 2015 2:18:16 下午 org.apache.catalina.startup.HostConfig deployDirectory
 81 信息: Deployment of web application directory C:\Program Files\apache-tomcat-8.0.24\webapps\Purchase has finished in 5,278 ms
 82 七月 18, 2015 2:18:16 下午 org.apache.catalina.startup.HostConfig deployDirectory
 83 信息: Deploying web application directory C:\Program Files\apache-tomcat-8.0.24\webapps\ROOT
 84 七月 18, 2015 2:18:16 下午 org.apache.catalina.startup.HostConfig deployDirectory
 85 信息: Deployment of web application directory C:\Program Files\apache-tomcat-8.0.24\webapps\ROOT has finished in 45 ms
 86 2015-07-18 14:18:15,993 [localhost-startStop-1] ERROR [org.springframework.web.servlet.DispatcherServlet] - Context initialization failed
 87 org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0‘: Invocation of init method failed; nested exception is javax.validation.ValidationException: Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
 88 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
 89 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
 90 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
 91 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
 92 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
 93 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
 94 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
 95 at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
 96 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
 97 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
 98 at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
 99 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
100 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
101 at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
102 at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
103 at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
104 at javax.servlet.GenericServlet.init(GenericServlet.java:158)
105 at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1231)
106 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)
107 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1031)
108 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4914)
109 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5201)
110 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
111 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
112 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
113 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
114 at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1101)
115 at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1786)
116 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
117 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
118 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
119 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
120 at java.lang.Thread.run(Thread.java:744)
121 Caused by: javax.validation.ValidationException: Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
122 at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:271)
123 at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:184)
124 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
125 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
126 ... 32 more

解决方法:添加jsr303-validation包或者添加maven包的依赖

<dependency>
<groupId>org.apache.bval</groupId>
<artifactId>bval-jsr303</artifactId>
<version>0.5</version>
</dependency>

时间: 2024-10-27 04:47:14

javax.validation.ValidationException: Unable to create a Configuration, because no Bean Validation provider could be found的相关文章

Exception in thread &quot;main&quot; javax.validation.ValidationException: Unable to find a default provider

Exception in thread "main" javax.validation.ValidationException: Unable to find a default provider 在使用Spring MVC+Mybatis整合的时候出现上面的问题 要将下面三个包加入项目的BuildPath中才行:    hibernate-validator-4.2.0.Final.jar    validation-api-1.0.0.GA.jar    slf4j-api-1.6

hibernate 错误:org.hibernate.HibernateException: Unable to get the default Bean Validation factory

最近在自学Hibernate与Struts2进行集成时,出现了一个错误,错误截图如下: 错误代码如下: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for

使用hibernate时出现 org.hibernate.HibernateException: Unable to get the default Bean Validation factory

hibernate 在使用junit测试报错: 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.appl

Spring3.1 对Bean Validation规范的新支持(方法级别验证)

一.Bean Validation框架简介 写道 Bean Validation standardizes constraint definition, declaration and validation for the Java platform. 大体意思是:Bean Validation 标准化了Java平台的约束定义.描述.和验证. 详细了解请参考:http://beanvalidation.org/ Bean Validation现在一个有两个规范: 1.Bean Validatio

关于JAX-WS的Unable to create JAXBContext错误

参考: http://53873039oycg.iteye.com/blog/1979421 今天学了下Jax-Ws的一个简单的例子,刚开始发布时遇到如下错误: Java代码 com.sun.xml.internal.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class com.test.service.jaxws.add is not found. Have you run APT to generate

Genymotion Unable to create Virtual Device:Connection timeout

Genymotion Unable to create Virtual Device:Connection timeout 解决办法: 1.进入C:\Users\[UserName]\AppData\Local\Genymobile,打开genymotion.log,在日志最后找到镜像下载链接和保存路径: 2017-12-16T00:40:08+08:00 [Genymotion:3244] [warning] Downloading list of shared templates faile

Tomcat配置多数据源出现Unable to create initial connections

迁自恶心人的网易博客 2017-06-27完整标题:Tomcat配置多个JNDI数据源(Postgresql)出现Unable to create initial connections of pool 版本说明 tomcat7Postgresql9.1 问题描述 在conf/context.xml中配置了两个数据源指向如下: <Resource name="jdbc/web" auth="Container" type="javax.sql.Dat

python pip fatal error in launcher unable to create process using

用pip安装一个包,不知道为啥,就报了这个错误:python pip fatal error in launcher unable to create process using “” 百度了一下,用下面的命令可以解决,搞定 python2 -m pip install XXX  另外,Python3 的pip我用python3 -m pip install --upgrade pip 搞定

File upload error - unable to create a temporary file

php上传图片的时候会报错: File upload error - unable to create a temporary file 文件上传错误 - 无法创建一个临时文件 你只需要打开你的php.ini文件,设置upload_tmp_dir="f:\temp"  然后重启环境就可以了,如果还不行就去看看文件夹的权限是否有权限,赋予写入权限就好了