instrument JDK8 failed with VerifyError

331 views
Skip to first unread message

cao jian

unread,
Jun 15, 2015, 9:32:46 PM6/15/15
to zorka...@googlegroups.com
try to use zorka with JDK8, got the following error

org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.view.InternalResourceViewResolver]: Factory method 'defaultViewResolver' threw exception; nested exception is java.lang.VerifyError: Expecting a stackmap frame at branch target 64
Exception Details:
  Location:
    org/springframework/web/servlet/view/AbstractCachingViewResolver$1.render(Ljava/util/Map;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V @40: iconst_1
  Reason:
    Expected stackmap frame at this location.
  Bytecode:

it seems we can use -UseSplitVerifier to avoid the error, however JDK8 doesn't support it, any idea how to resolve it? thanks so much

Rafal Lewczuk

unread,
Jul 20, 2015, 4:06:12 PM7/20/15
to zorka...@googlegroups.com

Hi,

(sorry for answering so late for this question)

Latest versions of zorka should automatically detect and handle JDK7 and JDK8 bytecodes with type annotations. This might be a bug in spring.bsh script, please perform the following test: exclude spring.bsh and check if error occurs.

Which version of Spring Framework is used by your application ?

Regards,
rle

Maxim Kollegov

unread,
May 18, 2018, 12:28:04 AM5/18/18
to Zorka Users
We have absolutely the same problem.
JDK8, Springboot 2 and zorka
When spring.bsh included in config then spring not start properly

2018-05-18 03:14:53.693 WARN [main] reqId: --- ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException
Exception Details: Location: org/springframework/web/servlet/view/AbstractCachingViewResolver$1.render(Ljava/util/Map;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V @27: iconst_1 Reason: Expected stackmap frame at this location. Bytecode:



Rafal Lewczuk

unread,
May 18, 2018, 2:53:33 AM5/18/18
to Zorka Users
Hi,

I've seen this recently  also on Spring Boot 1.5 but did not investigate this in full detail (yet). Spring might have some of its own instrumentation on some methods, I've seen this on JDBC drivers. 

Quick workaround for this is adding suspect classes to tracer.exclude in zorka.properties and commenting out instrumentation definitions in spring.bsh that correspond to classes that caused VerifyError. 

Regards,
rle

Rafal Lewczuk

unread,
Jun 12, 2018, 2:44:47 AM6/12/18
to Zorka Users

Ok, I've fixed it. It seems that JDK8 also enforces valid stackframe information on JDK6 bytecode format (major version 50), while JDK7 enforced from version 51 up. One-liner fix is here:


It is on development branch 1.90.x but trivial to backport it to Zorka 1.0.16. I'm thinking about maintenance release 1.0.17 but not decided yet (lack of time overall, sorry). 

Sorry it took so long.

Regards,
rle

Reply all
Reply to author
Forward
0 new messages