13

So I'm getting these errors

[junit] Illegal local variable table length 17 in method test.nz.ac.massey.cs.sdc.log4jassignment.s06005586.AppenderLayoutTest.()V

[junit] java.lang.VerifyError: Expecting a stackmap frame at branch target 11 in method test.nz.ac.massey.cs.sdc.log4jassignment.s06005586.StressTest.()V at offset 4

[junit] java.lang.ClassFormatError: Illegal local variable table length 17 in method test.nz.ac.massey.cs.sdc.log4jassignment.s06005586.AppenderLayoutTest.()V

And I would like to know how I can fix it...

What I've Read:

What I've Done:

Resources:

For some really crazy reason the JUnit Passes on target="test" but fails on target="emmatest".

This is the output on command prompt from java -version

java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b05)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)

I've tried setting the default arguments for my java7 JRE to -XX:-UseSplitVerifier from here

arguments
(source: iforce.co.nz)

I've also tried to make it complaint with JDK 1.6 on the Project Properties.

complaint
(source: iforce.co.nz)

JUnit direct testing results (no errors on the trace)

junit
(source: iforce.co.nz)

I'm out of options, please help! :(

Community
  • 1
  • 1
classicjonesynz
  • 4,012
  • 5
  • 38
  • 78

2 Answers2

7

Sounds strange.

First, check your code to see if you have used new grammar features introduced in JDK 1.7, like try-with-resource or diamond operator.

I met this VerifyError before, when using cobertura. However, when I set -XX:-UseSplitVerifier to the junit task, it is resolved. I set it by specifying a <jvmarg> nested element to junit task.

Also, most of the coverage libs seem to support JDK1.7 very poorly. However, Jacoco works fine with JDK1.7 so I am using it for now.

Dante WWWW
  • 2,729
  • 1
  • 17
  • 33
  • Thanks I managed to fix it, by just downloading the [JDK6u25](http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-download-346242.html) and changing the library path in my project/eclipse. – classicjonesynz Aug 30 '12 at 06:19
  • @Killrawr Happy to see that! Yes, downgrade the JDK version is also a choice. – Dante WWWW Aug 30 '12 at 08:19
  • 1
    @Killrawr finally you managed to get rid of it by downgrading to java6 as I advised :). – Bharat Sinha Aug 30 '12 at 09:22
  • @SiB Could you take a look at [basic.xml is not in either pmd-bin-5.0-alpha or pmd-bin-5.0.0 directories](http://stackoverflow.com/questions/12193950/basic-xml-is-not-in-either-pmd-bin-5-0-alpha-or-pmd-bin-5-0-0-directories) – classicjonesynz Aug 30 '12 at 09:45
  • Thanks for the pointer: *Cobertura* seems to be the root in my case, too. – bentolor May 29 '13 at 11:45
1

-XX:-UseSplitVerifier

Does work for me and I did not have to downgrade JRE from 1.7 to 1.6

Amol M Kulkarni
  • 21,143
  • 34
  • 120
  • 164