VerifyError

Java Programming Language

Severity: Moderate

What it means

Oracle: thrown when the verifier detects that a class file, though well formed, contains some sort of internal inconsistency or security problem.
Messages from Java's verifier include Bad type on operand stack, Expecting a stackmap frame at branch target 65, Inconsistent stackmap frames at branch target and Bad return type.
Stack Overflow: it usually means a library used by the application generates bytecode that doesn't pass the verification.

Affected Models

  • Java programs at run time

How to Fix It

  1. Find what changed the class named in the message: a code coverage tool, a mocking library, an obfuscator or a Java agent.

  2. Update that tool. An old version can write bytecode that a newer Java refuses.

  3. Clean and rebuild, so no class from an older setup is left.

Frequently Asked Questions

Can I just turn verification off?

Stack Overflow's answer mentions -noverify as a workaround. It switches off a safety check, and Java has deprecated it: from Java 13, using it prints a warning that it will likely be removed. Fix the tool instead.