Error creating bean 'entityManagerFactory', Nested HibernateException: Unable to get the default Bean Validation factory

后端 未结 1 1965
广开言路
广开言路 2021-01-23 19:44

Many question have been asked on this topic, but none them seems to resolve my issue.

I trying a sample project with Maven, Spring, Hibernate and JPA with Mysql 5.5. I

相关标签:
1条回答
  • 2021-01-23 20:22

    Add the geronimo-osgi-locator to add the missing class file. It seems tomcat and other app-servers also ship those class packaged with their appserver.

    The javax.validation.Validation.java in line 209 accesses the ProviderLocator, which is imported in line 38.

    javax.validation.Validation.java
    import org.apache.geronimo.osgi.locator.ProviderLocator; List serviceProviders = ProviderLocator.getServices(ValidationProvider.class.getName(), this.getClass(), cl);

    Maven Dependency:

        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-osgi-locator</artifactId>
            <version>1.1</version>
        </dependency>
    
    0 讨论(0)
提交回复
热议问题