(Ljava/lang/String;)Ljava/lang/Integer; @65: areturn

IDEA中启动tomcat报错如下,导致项目启动失败:

2022-10-30 17:06:31 ERROR [RMI TCP Connection(3)-127.0.0.1] xxx:(251) - 根据文件xxx]扩展点定义[xxx],创建扩展点实例时出错
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'kmReviewQuartzImpl' defined in ServletContext resource xxx/spring.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate xxx.KmReviewQuartzImpl]: No default constructor found; nested exception is java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    xxx.method(Ljava/lang/String;)Ljava/lang/Integer; @65: areturn
  Reason:
    Type integer (current frame, stack[0]) is not assignable to reference type
  Current Frame:
    bci: @65
    flags: { }
    locals: { 'java/lang/String', '[Ljava/lang/String;', integer }
    stack: { integer }
  Bytecode:
    0x0000000: 1007 bd00 f159 0312 f653 5904 12f8 5359
    0x0000010: 0512 fa53 5906 12fc 5359 0712 fe53 5908
    0x0000020: 1301 0053 5910 0613 0102 534c 033d a700
    0x0000030: 1c2a 2b1c 32b6 0115 9900 0f1c 9a00 0610
    0x0000040: 07b0 1cb8 0172 b084 0201 1c2b bea1 ffe4
    0x0000050: 03b8 0172 b0                           
  Stackmap Table:
    append_frame(@49,Object[#313],Integer)
    same_frame(@66)
    same_frame(@71)
    same_frame(@74)

根据(Ljava/lang/String;)Ljava/lang/Integer; @65: areturn排查报错原因

类型引用有问题

public static Integer getIndex(String week){
        String[] weekDays = { "周日", "周一", "周二", "周三", "周四", "周五", "周六" };//格式
        Integer index = 0;
        for(int i = 0 ;i<weekDays.length;i++){
            if(week.equals(weekDays[i])){
                if(i == 0){//周日
                    return index = 7;
                }
                return index = i;
            }
        }
        return 0;
    }

把Integet改为int就可以了

public static int getIndex(String week){
        String[] weekDays = { "周日", "周一", "周二", "周三", "周四", "周五", "周六" };//格式
        int index = 0;
        for(int i = 0 ;i<weekDays.length;i++){
            if(week.equals(weekDays[i])){
                if(i == 0){//周日
                    return index = 7;
                }
                return index = i;
            }
        }
        return 0;
    }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值