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

后端 未结 1 1990
广开言路
广开言路 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:

        
            org.apache.geronimo.specs
            geronimo-osgi-locator
            1.1
        
    

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