“The Bean Validation API is on the classpath but no implementation could be found” preventing startup

前端 未结 3 1935
日久生厌
日久生厌 2021-02-19 08:32

I am using Spring Tool Suite to work with ReST services in Java. But at the very first point I am not able to start my first simple application. Please help. I am getting below

相关标签:
3条回答
  • 2021-02-19 09:08

    I faced the same issue. My project has almost a year on production and this week I needed to make some changes, and for surprise, the project could not even be built. I solved the issue by adding the following dependency to my project.

    <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>${your-desired-version-matching-project-own}</version>
    </dependency>
    

    Note: I was using spring starters dependency, but still not loading that dependency.

    0 讨论(0)
  • 2021-02-19 09:13

    In my case, I added the following dependency and its worked, Even I do not need any validation, maybe the Java update caused this issue.

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-validation</artifactId>
    </dependency>
    
    0 讨论(0)
  • 2021-02-19 09:19

    Delete all files from <user_home>/.m2/repository and try "maven --> install project.

    It seems that a file got corrupted. So in order to download the files correctly, try this procedure.

    It should not be required to add any other dependencies at all. 'web' injects the validators that are missing.

    Had the same issue here and it got solved by doing this procedure. You only need to do this once and then you will be good to go again. (sometimes - don't ask why - the local m2 repo gets corrupted).

    Hope it helps. Regards, Ivan

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