首页 > 解决方案 > 当我想连接mysql时运行我的应用程序spring boot时出现问题

问题描述

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaautoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: @Temporal should only be set on a java.util.Date or java.util.Calendar property: org.sid.cinema.entities.Seance.her Debut
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1769) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.

标签: javamysqlspringspring-boothibernate

解决方案


我以前遇到过这个问题。当您从错误的包导入时会发生这种情况。

利用

import java.sql.Date;

代替

import java.util.Date;

希望这会有所帮助。


推荐阅读