简体   繁体   English

当前帧的堆栈大小与堆栈映射不匹配

[英]Current frame's stack size doesn't match stackmap

We are upgrading spring from 4.3.20.Release to 5.3.20 and Hibernate version is 5.2.3.Final with Java 11 and Tomcat 9. All the changes are getting compiled and working well in local.我们正在将 spring 从 4.3.20.Release 升级到 5.3.20,Hibernate 版本为 5.2.3.Final,Java 11 和 Tomcat 9。所有更改都在本地编译并运行良好。 But when deployed to server via jenkins they are failing with "VerifyError" during Bean Creation.但是当通过 jenkins 部署到服务器时,它们在创建 Bean 期间失败并出现“VerifyError”。

I am aware of "Xverify:none" option to pass over this, but wanted to fix it without Xverify:none solution.我知道“Xverify:none”选项可以忽略此问题,但想在没有 Xverify:none 解决方案的情况下修复它。

Stack Trace:堆栈跟踪:

org.springframework.beans.factory.BeanCreationException: Error creating bean with 
name 'appStatusController': Lookup method resolution failed; nested exception is 
java.lang.IllegalStateException: Failed to introspect Class 
[com.officehours.controller.AppStatusController] from ClassLoader 
[ParallelWebappClassLoader
     context: stage
     delegate: false
       ----------> Parent Classloader:
     java.net.URLClassLoader@2436ea2f] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor 
     .determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:289)
    ....
    .....
     
  Caused by: java.lang.VerifyError: Inconsistent stackmap frames at branch target 1285
  Exception Details:
  Location:    com/officehours/controller/AppStatusController.appOk(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/springframework/web/servlet/ModelAndView; @1282: goto

  Reason:
     Current frame's stack size doesn't match stackmap.
  Current Frame:
     bci: @1282
     flags: { }
     locals: { 'com/officehours/controller/AppStatusController', 
           'javax/servlet/http/HttpServletRequest', 
           'javax/servlet/http/HttpServletResponse', 
           'com/newrelic/agent/bridge/ExitTracer', integer, null, top, top, top, top, 
           top, top, 'javax/servlet/http/HttpServletResponse', 
           'javax/servlet/http/HttpServletRequest', 
           'com/officehours/controller/AppStatusController', integer, 
           'org/springframework/web/servlet/ModelAndView', top, top, top, top, top, 
           'java/lang/Throwable', 'javax/servlet/http/HttpServletResponse', 
           'javax/servlet/http/HttpServletRequest', 
           'com/officehours/controller/AppStatusController', 'java/io/File', 
           'java/io/LineNumberReader', top, top, 
           'org/springframework/web/servlet/ModelAndView', 
           'org/springframework/web/servlet/ModelAndView' }
    stack: { 'org/springframework/web/servlet/ModelAndView' }
 Stackmap Frame:
   bci: @1285
   flags: { }
   locals: { 'com/officehours/controller/AppStatusController', 
              'javax/servlet/http/HttpServletRequest', 
               'javax/servlet/http/HttpServletResponse', 
              'com/newrelic/agent/bridge/ExitTracer', integer, null, top, top, top, 
               top, top, top, 'javax/servlet/http/HttpServletResponse', 
               'javax/servlet/http/HttpServletRequest', 
               'com/officehours/controller/AppStatusController', integer, 
               'org/springframework/web/servlet/ModelAndView', top, top, top, top, 
               top, top, 'javax/servlet/http/HttpServletResponse', 
               'javax/servlet/http/HttpServletRequest', 
               'com/officehours/controller/AppStatusController', 'java/io/File', 
               'java/io/LineNumberReader', top, top, 
               'org/springframework/web/servlet/ModelAndView', 
               'org/springframework/web/servlet/ModelAndView' }
    stack: { 'org/springframework/web/servlet/ModelAndView','org/springframework/web/servlet/ModelAndView' }

Any suggestions on this would be highly appreciated as this is blocking me in moving further with other process (like production deployment)对此的任何建议将不胜感激,因为这阻碍了我进一步推进其他流程(如生产部署)

Finally, I was able to get to the root of it.最后,我能够找到它的根源。

This error was due to Double weaving of the code (1 which happens normally and 2 due to the newRelic instrumentation plugin which we used).这个错误是由于代码的双重编织(1 是正常发生的,2 是由于我们使用的 newRelic 检测插件)。 This comes into the picture when our application uses "AspectJ" and tries to have spring version > 4.2.当我们的应用程序使用“AspectJ”并尝试让 spring 版本 > 4.2 时,就会出现这种情况。

When we were comparing the Local Vs Server config and the only difference we noticed was the Instrumentation plugins.当我们比较本地与服务器配置时,我们注意到的唯一区别是 Instrumentation 插件。 We thought of removing these instrumentation plugins and seeing if that is helping us and when we removed the newRelic.jar we noticed that the application was up and running along with AspectJ code (Without Xverify In Place).我们考虑删除这些检测插件并查看这是否对我们有帮助,当我们删除 newRelic.jar 时,我们注意到该应用程序已启动并与 AspectJ 代码一起运行(没有 Xverify In Place)。

Upon checking it looks like a long open issue with newRelic and their team is working to identify it https://github.com/newrelic/newrelic-java-agent/issues/347经过检查,它看起来像是 newRelic 的一个长期未解决的问题,他们的团队正在努力识别它https://github.com/newrelic/newrelic-java-agent/issues/347

We implemented the Option-3 from there by modifying our newRelic.yml to include the following piece我们通过修改 newRelic.yml 以包含以下内容从那里实现了 Option-3

class_transformer:
com.newrelic.instrumentation.jax-rs-1.0:
    enabled: false
com.newrelic.instrumentation.spring-4.3.0:
    enabled: false

Post this the app was up and running as expected.发布此应用程序已按预期启动并运行。 Hope this helps!希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM