FacesContext.getCurrentInstance() throwing java.lang.VerifyError: Inconsistent stackmap frames at branch target exception

FacesContext.getCurrentInstance() throwing java.lang.VerifyError: Inconsistent stackmap frames at branch target exception

我已经检查了其他 Whosebug 答案,但其中 none 有关于 JSF facecontext 的答案,所以我不得不提出一个问题。 我们有 jdk 6、jsf 1.2 和 mySQL 5.5,现在我们已经升级到 java 8 和 mySQL 5.7。为此,我将 mySql-connector jar 从 3.1.11 替换为 5.1.18。但是当我启动 tomcat 时,它抛出如下异常:

SEVERE: Exception sending context initialized event to listener instance of class [com.sun.faces.config.ConfigureListener]
java.lang.VerifyError: Inconsistent stackmap frames at branch target 922
Exception Details:
  Location:
    web/clerk/webapp/iucs/officer/bean/OfficerScheduleBean.addOfficerSchedule()Ljava/lang/String; @922: invokestatic
  Reason:
    Type top (current frame, locals[41]) is not assignable to integer (stack map, locals[41])
  Current Frame:
    bci: @904
    flags: { }
    locals: { 'web/clerk/webapp/iucs/officer/bean/OfficerScheduleBean', 'java/lang/String', 'java/io/InputStream', 'java/util/List', 'java/io/BufferedReader', 'javax/servlet/http/HttpSession', 'web/clerk/webapp/iucs/userprofile/pojo/UserProfile', 'java/util/Map', 'java/util/List', 'web/clerk/webapp/iucs/officer/pojo/OfficerSchedule', 'java/lang/String', '[Ljava/lang/String;', integer, integer, 'java/util/Map', 'java/util/Set', integer, integer, 'web/clerk/webapp/iucs/officer/pojo/OfficerSchedule', 'java/util/Iterator', 'java/util/List', 'web/clerk/webapp/iucs/schedule/pojo/CourtType', 'web/clerk/webapp/iucs/schedule/pojo/Location', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'web/clerk/webapp/iucs/general/pojo/County', 'java/lang/String', integer, top, 'web/clerk/webapp/iucs/general/pojo/County', 'web/clerk/webapp/iucs/officer/pojo/OfficerSchedule', integer, integer, integer, integer, integer, integer }
    stack: { 'web/clerk/webapp/iucs/general/pojo/County' }
  Stackmap Frame:
    bci: @922
    flags: { }
    locals: { 'web/clerk/webapp/iucs/officer/bean/OfficerScheduleBean', 'java/lang/String', 'java/io/InputStream', 'java/util/List', 'java/io/BufferedReader', 'javax/servlet/http/HttpSession', 'web/clerk/webapp/iucs/userprofile/pojo/UserProfile', 'java/util/Map', 'java/util/List', 'web/clerk/webapp/iucs/officer/pojo/OfficerSchedule', 'java/lang/String', '[Ljava/lang/String;', integer, integer, 'java/util/Map', 'java/util/Set', integer, integer, 'web/clerk/webapp/iucs/officer/pojo/OfficerSchedule', 'java/util/Iterator', 'java/util/List', 'web/clerk/webapp/iucs/schedule/pojo/CourtType', 'web/clerk/webapp/iucs/schedule/pojo/Location', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'web/clerk/webapp/iucs/general/pojo/County', 'java/lang/String', integer, top, 'web/clerk/webapp/iucs/general/pojo/County', 'web/clerk/webapp/iucs/officer/pojo/OfficerSchedule', integer, integer, integer, integer, integer, integer, top, integer }
    stack: { }
  Bytecode:
    0x0000000: bb00 a559 2ab6 00a7 b600 adb8 00b2 b700
    0x0000010: b813 0720 b600 bcb6 00c0 b800 c312 fb4c
    0x0000020: 2ab6 0722 c600 112a b607 22b9 05c4 0100
    0x0000030: 0994 9a00 2a13 0725 12fb b802 ecbb 00a5
    0x0000040: 592a b600 a7b6 00ad b800 b2b7 00b8 1307.....

挖掘代码,我发现里面的错误方法是什么,FacesContext.getCurrentInstance();代码是错误的。当我检查相应的 jar 时,它指向 jsf-api.jar. 现在我知道一个这样的解决方案是添加 -noverify VM 的参数,但是,这仍然可能是查看我的生产环境的补丁,我无法弄清楚根本原因是什么以及解决方案是什么?

找到正确的论点: 实际上我尝试在安全模式下将 webdir 添加到环境变量中,但它也不起作用。所以我删除了它并将 -Xverify:none 添加到 tomcat 的参数中,它开始工作了。