java - 当我想连接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.
解决方案
我以前遇到过这个问题。当您从错误的包导入时会发生这种情况。
利用
import java.sql.Date;
代替
import java.util.Date;
希望这会有所帮助。
推荐阅读
- java - 处理 3 (JDK11) 中的非法反射访问错误
- azure - Azure-logicApps-将实体插入表中
- types - 什么数据类型最适合通过 i2C (arduino) 发送
- java - 当点击从 WorkManager 发送的通知时,使用导航组件启动特定片段
- java - 如何从日历对话框中获取相关的星期几而不是先前选择的日期
- android-studio - 从 Android-Studio 运行时,应用程序给出安装失败的错误
- git - Intellij IDE - 在 GIT 分支之间切换时删除文件夹
- python - 基于另一个 Django 模型的多个字段检索唯一 Django 对象的计数
- javascript - 如何创建目录树的基于 JavaScript 对象的表示
- c# - 如何在ac#类中设置数据(多类)