Conversion not supported for type java.time.LocalDateTime报错

springboot启动后,使用postman访问路径,提示Conversion not supported for type java.time.LocalDateTime错误,网上查资料了解到,
在Entity实体类内java8特性的LocalDateTime要求mysql-connector-java版本不能低于5.1.37,pom文件修改为5.3.7版本后可以正常运行

<dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>5.3.7</version>
        </dependency>
  • 6
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Conversion not supported for type java.time.LocalDate误通常是由于数据库驱动包版本不兼容导致的。根据引用\[1\]和引用\[2\]的内容,可以看出在使用Spring Boot和MyBatis-Plus时,需要确保mysql-connector-java版本不低于5.1.37,并且其他依赖版本也要符合要求。如果你的项目是一个大项目,不方便进行升级,那么可以尝试以下解决方法: 1. 检查你的项目中mysql-connector-java的版本是否低于5.1.37。如果是低于这个版本的话,可以尝试将其升级到5.1.37或更高版本。 2. 检查其他相关依赖的版本是否符合要求。根据引用\[1\]和引用\[2\]的内容,你需要确保spring-tx、mybatis-plus-boot-starter和druid-spring-boot-starter的版本都符合要求。 3. 如果你无法升级依赖版本,可以尝试使用其他方法解决这个问题。根据引用\[3\]的内容,可以参考链接中提供的解决方法进行尝试。 总结来说,Conversion not supported for type java.time.LocalDate误通常是由于数据库驱动包版本不兼容导致的。你可以尝试升级mysql-connector-java版本和其他相关依赖的版本,或者参考其他解决方法来解决这个问题。 #### 引用[.reference_title] - *1* [Conversion not supported for type java.time.LocalDateTime](https://blog.csdn.net/qq976748881/article/details/118941044)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [Conversion not supported for type java.time.LocalDateTime](https://blog.csdn.net/J_XiaoW/article/details/120413088)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [conversion to class java.time.LocalDateTime from 8 not supported处理解决](https://blog.csdn.net/qq_41766663/article/details/130719844)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值