当前位置:   article > 正文

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

ljava/lang/integer

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排查报错原因

类型引用有问题

  1. public static Integer getIndex(String week){
  2. String[] weekDays = { "周日", "周一", "周二", "周三", "周四", "周五", "周六" };//格式
  3. Integer index = 0;
  4. for(int i = 0 ;i<weekDays.length;i++){
  5. if(week.equals(weekDays[i])){
  6. if(i == 0){//周日
  7. return index = 7;
  8. }
  9. return index = i;
  10. }
  11. }
  12. return 0;
  13. }

把Integet改为int就可以了

  1. public static int getIndex(String week){
  2. String[] weekDays = { "周日", "周一", "周二", "周三", "周四", "周五", "周六" };//格式
  3. int index = 0;
  4. for(int i = 0 ;i<weekDays.length;i++){
  5. if(week.equals(weekDays[i])){
  6. if(i == 0){//周日
  7. return index = 7;
  8. }
  9. return index = i;
  10. }
  11. }
  12. return 0;
  13. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/349202
推荐阅读
相关标签
  

闽ICP备14008679号