大家好,我是使用Spring框架的新手,我试着遵循那里网站上的指南
pom.xml:
<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
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);
}
}但是当我运行应用程序时,我得到了这个错误
***************************
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环境工具套件,这里有什么问题吗?谢谢
发布于 2017-10-08 23:48:19
我删除了.m2/repository,然后使用1.5.7.RELEASE重新构建,然后启动应用程序。我认为从Maven主路径读取jar文件时可能存在一些冗余问题。
https://stackoverflow.com/questions/46518513
复制相似问题