Spring Boot: New Project - UnsatisfiedDependencyException: Error creating bean with name 'methodValidationPostProcessor'

前端 未结 1 1731
礼貌的吻别
礼貌的吻别 2021-01-14 15:57

I just created a project using Spring Boot (1.5.2.BUILD-SNAPSHOT) on IntelliJ IDEA 2016.3.4 with Spring Initializr.

When I try to run the project I got an exception

相关标签:
1条回答
  • 2021-01-14 16:34

    Resolved

    For some reason artefact spring-boot-starter-web added a dependency to hibernate-validator, therefore spring was expecting me to configure a validator dependency.

    I have remove that dependency adding an exclusion to my pom.xml.

       <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-validator</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    

    I have added more dependencies including JPA and It is still working fine.

    0 讨论(0)
提交回复
热议问题