- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我刚开始使用 springBoot 进行开发,我想运行一个示例来学习如何在 elasticsearch 数据库中写入一些数据。所以我从这里下载了 git 示例:
https://github.com/TechPrimers/spring-data-elastic-example-2
所以当我打开它时出现错误:
::Spring Boot::(v1.5.1.RELEASE)
2018-08-08 07:42:01.935 INFO 3898 --- [ main] c.t.e.SpringElasticDemoApplication : Starting SpringElasticDemoApplication on phil-VirtualBox with PID 3898 (/home/phil/eclipse/workspace/spring-data-elastic-example-2-master/target/classes started by phil in /home/phil/eclipse/workspace/spring-data-elastic-example-2-master)
2018-08-08 07:42:01.944 INFO 3898 --- [ main] c.t.e.SpringElasticDemoApplication : No active profile set, falling back to default profiles: default
2018-08-08 07:42:02.078 INFO 3898 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@2c34f934: startup date [Wed Aug 08 07:42:02 CEST 2018]; root of context hierarchy
2018-08-08 07:42:02.949 INFO 3898 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2018-08-08 07:42:03.085 INFO 3898 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'elasticsearchTemplate' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=elasticConfiguration; factoryMethodName=elasticsearchTemplate; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/techprimers/elastic/config/ElasticConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration; factoryMethodName=elasticsearchTemplate; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfiguration.class]]
2018-08-08 07:42:03.115 INFO 3898 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2018-08-08 07:42:03.137 INFO 3898 --- [ main] .RepositoryConfigurationExtensionSupport : Spring Data JPA - Could not safely identify store assignment for repository candidate interface com.techprimers.elastic.repository.UsersRepository.
2018-08-08 07:42:03.160 INFO 3898 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'httpRequestHandlerAdapter' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration; factoryMethodName=httpRequestHandlerAdapter; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; factoryMethodName=httpRequestHandlerAdapter; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class]]
2018-08-08 07:42:03.608 INFO 3898 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$175e2308] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-08-08 07:42:03.750 WARN 3898 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tomcatEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.HttpEncodingAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.http.encoding-org.springframework.boot.autoconfigure.web.HttpEncodingProperties': Initialization of bean 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.
2018-08-08 07:42:03.758 ERROR 3898 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
The Bean Validation API is on the classpath but no implementation could be found
Action:
Add an implementation, such as Hibernate Validator, to the classpath
我猜这是一个 maven 问题所以我去了我的项目的 .pom 目录并执行了 mvn verify
这是错误协议(protocol)
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Unsatisfied dependency expressed through method 'dataSource' parameter 0;
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': Initialization of bean 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.
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Unsatisfied dependency expressed through method 'dataSource' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': Initialization of bean 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.
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': Initialization of bean 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.
抱歉,堆栈跟踪太长,无法放入此处。我认为通过添加 spring-boot-starter-web 依赖项
我已经包含了所需的东西。这是 pom.xmlhttp://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0
<groupId>com.techprimers.elastic</groupId>
<artifactId>spring-elastic-demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>spring-elastic-demo</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
所以我按照 https://stackoverflow.com/a/49665445/9326543 中的步骤操作但没有任何改变。有谁知道如何解决这个问题。谢谢
最佳答案
在我的例子中,我添加了以下依赖项并且它起作用了,即使我不需要任何验证,也可能是 Java 更新导致了这个问题。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
关于java - 无法运行 springboot 应用程序 : The Bean Validation API is on the classpath but no implementation could be found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51739564/
当我尝试输入时,我正在关注 Ray Wenderlich ( https://videos.raywenderlich.com/screencasts/545-server-side-swift-wi
我正在使用 javax.validation.Validation 来验证 jpa 实体。我总是针对相同的实体进行验证。 我想知道是对所有验证使用一个 validator 更好,还是每次验证时实例化一
Controller : @RequestMapping(...) public void foo(@Valid Parent p){ } class Parent { @NotNull // j
在 login.phtml 中,validator 和 validate 之间有什么区别 - 有人可以解释下面每一行的含义 function onepageLogin(button)
我有一个 java bean 用于将 JSON 消息发送到 spring @RestController 并且我有 bean 验证设置并使用 @Valid 运行得很好。但我想转移到 Protobuf/
我正在使用 vee-validate 来验证注册表单,我编写了如下代码,
使用 有什么区别属性和 标签? 我应该什么时候使用哪一种? 最佳答案 validator属性允许您引用独立的托管 bean 方法,而不仅仅是像这样的验证器
我们有这个 Alamofire 错误处理: Alamofire.request(.GET, getUrl("mystuff")).responseData { response in guar
以下代码创建了两个单选按钮。每个选项都包含一个日期值,该日期值已成功转换为格式为“yyyy-MM-dd”的标签。一旦我做出选择并单击下一步按钮,我就会收到以下错误“j_idt12:comDateCho
是否有类似的验证: req.checkBody('property', 'should be present').isPresent(); 值本身并不重要。 现在我使用这个解决方案: .isLengt
系列文章: 1、async-validator 源码学习(一):文档翻译 2、async-validator 源码学习笔记(二):目录结构 3、async-validator 源码学习笔记(三):ru
我正在使用 Backbone.Validation插入。我有一个模型可以在服务器端进行唯一性检查。我如何让 backbone.validation 识别错误并运行我设置的回调以显示返回的错误消息? t
我有一个 Knockout.Validation 场景,我认为该场景相当普遍,但尚未通过在网络上搜索和本网站上的各种答案找到解决方案。 我正在验证的属性在 ajax 调用之后才会添加到可观察到的 kn
我是 Knockout JS 的新手。我需要一个验证器来验证用户将在文本框中输入的日期。为此编写了如下代码 ko.validation.rules['date'] = { validator:
如何在 JSF 验证器中比较两个字符串是否相等? if (!settingsBean.getNewPassword().equals(settingsBean.getConfirmPassword()
我有简单的域: package app class Customers { String CUSTOMER String NOTE static mapping = {
我正在使用 ember-validations 来验证表单中的模型。 如果我使用 createRecord 创建记录,则模型的实例已经过验证,因此在用户输入值之前表单已经显示验证错误。 我只想在提交表
我有两种不同的服务:第一个是将对象保存到数据库,第二个是更新现有对象。 我正在对我的对象使用验证约束,例如(@NotBlank、@Size、@Pattern 等),在第一种情况下,我需要验证对象的所有
我有 2 个 ensure - 验证装饰器用于 2 个字段:password 和 retypePassword。我想在填写 retypePassword 字段时检查这两个字段是否相等。 问题是,当我在
I'm aware that it's a bug ,但是在域类上调用 validate() 会覆盖之前放入的任何拒绝: def save = { def assignment = new A
我是一名优秀的程序员,十分优秀!