【踩坑日记】springboot3.0导致的问题

背景

准备体验liteflow: liteflow官网
新建了个springboot项目,JDK版本17,springboot版本默认的3.0.3,我就按着liteflow文档一步一步来的操作的,但是死活不行,怀疑人生…

问题

  1. 问题1:项目正常启动,但是接口请求不通:This application has no explicit mapping for /error, so you are seeing this as a fallback.
    在这里插入图片描述
  2. 问题2:
    然后我就找啊找,首先按照我Application的位置,应该是所有包下的内容都可以扫描到的,我就去掉了ComponentScan,去掉后直接无法启动:
    A component required a bean of type ‘com.yomahub.liteflow.core.FlowExecutor’ that could not be found.
    在这里插入图片描述

解决办法

真的很坑,Springboot3.0以上对应的SPI变了,但是liteflow里还没有支持。
@Resource
3.0 是import jakarta.annotation.Resource;
2.7.5是import javax.annotation.Resource;

 <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.0.3</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

import jakarta.annotation.Resource;

所以将Springboot的版本降到2.X即可

  <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.5</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

import javax.annotation.Resource;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值