首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Spring框架:执行Spring Boot后出现Bean验证Api错误

Spring框架:执行Spring Boot后出现Bean验证Api错误
EN

Stack Overflow用户
提问于 2017-10-02 09:39:34
回答 1查看 203关注 0票数 1

大家好,我是使用Spring框架的新手,我试着遵循那里网站上的指南

pom.xml:

代码语言:javascript
复制
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>SpringTutorial.com</groupId>
<artifactId>spring-tutorial.com</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Spring Boot Tutorial</name>
<description>A simple tutorial for spring boot</description>

 <!-- Inherit defaults from Spring Boot -->
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.7.RELEASE</version>
</parent>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
</dependencies>


<properties>
    <java.version>1.8</java.version>
</properties>

我在src/ Application.java /java中创建了如下代码。

Application.java

代码语言:javascript
复制
package Application.com;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

}

但是当我运行应用程序时,我得到了这个错误

代码语言:javascript
复制
***************************
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

我使用的是spring环境工具套件,这里有什么问题吗?谢谢

EN

回答 1

Stack Overflow用户

发布于 2017-10-08 23:48:19

我删除了.m2/repository,然后使用1.5.7.RELEASE重新构建,然后启动应用程序。我认为从Maven主路径读取jar文件时可能存在一些冗余问题。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46518513

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档