Error creating bean with name 'org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean#0

后端 未结 5 742
后悔当初
后悔当初 2021-01-05 17:09

Im new to hibernate, and not quite sure what is wrong with my application. So i have these 2 modules: Core and Website.

  • Module core has all the entities, daos
相关标签:
5条回答
  • 2021-01-05 17:18

    If you are using hibernate-validator, in my case, I just added one more dependency as below: (because javax.xml.bind will not be available on classpath by default in JAVA 9 and above, please refer to https://docs.oracle.com/javase/9/docs/api/java.xml.bind-summary.html )

    0 讨论(0)
  • 2021-01-05 17:18

    The problem was with the WAR only.

    0 讨论(0)
  • 2021-01-05 17:22

    You need to have all require dependency

        <!-- JSR 303 Dependencies -->
    
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.1.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>5.4.3.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator-annotation-processor</artifactId>
            <version>5.4.3.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator-cdi</artifactId>
            <version>5.4.3.Final</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
            <version>3.3.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.el</artifactId>
            <version>3.0.1-b08</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml</groupId>
            <artifactId>classmate</artifactId>
            <version>1.3.1</version>
        </dependency>
    
    0 讨论(0)
  • 2021-01-05 17:41

    I don't think that you can use hibernate-validator 5.2.2 (for Hibernate 5) with Hibernate 4. Try to use hibernate-validator 4.2.0.Final.

    And there are two ehcache jars in your class path!

    Try to use Maven or Gradle build to get valid dependences.

    0 讨论(0)
  • 2021-01-05 17:42

    You don't need to remove logback-classic.jar, Instead the root cause seems to be the missing definition for org.hibernate.validator.internal.engine.ConfigurationImpl As per Google, you need to include http://mvnrepository.com/artifact/org.hibernate/hibernate-validator If its a maven project then the below config in your pom dependencies shall make things work smooth for you

    <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>5.2.4.Final</version>
    

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