我在我的项目中尝试实现休眠时遇到问题。我使用 Maven 和 Spring 在 Java 中开发我的项目,但是当我尝试运行我的项目时,无法正常工作。请帮我解决这个错误,我不知道如何解决这个问题。或者请告诉我出了什么问题15:03:39.224 [main] INFO o.h.validator.internal.util.Version - HV000001: Hibernate Validator 5.3.5.Final-redhat-215:03:39.232 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@5bcea91b: defining beans [dataSource,hibernate4AnnotatedSessionFactory,SesionDAO]; root of factory hierarchy15:03:39.232 [main] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy method 'close' on bean with name 'dataSource'Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernate4AnnotatedSessionFactory' defined in class path resource [spring.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Error applying BeanValidation relational constraints at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1699) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:573) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:740)请帮我解决这个问题。
1 回答
智慧大石
TA贡献1946条经验 获得超3个赞
您需要放置以下依赖项:
<dependency>
<groupId>com.fasterxml</groupId>
<artifactId>classmate</artifactId>
<version>1.4.0</version>
</dependency>
需要编译依赖的范围。如果它不是由您的应用程序服务器提供的。
添加回答
举报
0/150
提交
取消