1
java.lang.VerifyError: Inconsistent stackmap frames at branch target 775
Exception Details:
Location:
    com/../..../class.method()
Reason:
    Type 'java/sql/Connection' (current frame, locals[6]) is not assignable to 'java/lang/Class' (stack map, locals[6])

This is what I get when I try to execute junit.

junit 4.8.1 org.mockito 1.8.5 org.powermock 1.3.9 javassist 3.12.0-GA

6 Answers 6

6

Which JDK version are you using?

I had a similar issue and solved it by adding -noverify to the JVM arguments.

Sign up to request clarification or add additional context in comments.

2 Comments

JDK version: 1.7.0_60
I am using jdk 8 and this solves my issue :)
3

if you use jdk8+,you maybe need update javassist,javassist 3.20- is not support jdk8+.

<dependency>
    <groupId>org.javassist</groupId>
    <artifactId>javassist</artifactId>
    <version>3.20.0-GA</version>
    <scope>test</scope>
</dependency>

Comments

0
I was facing the same issue.As i was using Proguard at my end.So i added

**-dontpreverify**

in proguard.txt file. Beause this issue is related to Java 7

You can check here:- [enter link description here][1] 

  [1]: http://proguard.sourceforge.net/manual/usage.html

The above case is if you are using proguard.

Comments

0

I had similar issues using JDK 1.7.0_79, and I could solve it by adding below argument to VM argument. -noverify

1 Comment

While this might provide an answer to the question, some explanation is required. Please update the answer with some explanation of how and why this solution works.
0

Below option has worked for me. My java version is 1.8.0_181

    <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-api-easymock</artifactId>
        <version>${powermock.version}</version>
        <scope>test</scope>
        <exclusions>
                <exclusion>
                    <groupId>org.javassist</groupId>
                        <artifactId>javassist</artifactId>
                </exclusion>
            </exclusions>
    </dependency>

    <dependency>
        <groupId>org.javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>3.21.0-GA</version>
        <scope>test</scope>
    </dependency>

Comments

0

fixed similar issue "java.lang.VerifyError" (didn't mention stackmap) when creating a mock, by bumping mockito version from 2.5.0 to 2.24.5 FWIW...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.