|
Hello,
I am part of a team that uses sonar for over two years now. We have recently started generating class files(binaries) targeted to Java 1.7 and noticed that a number of tests fail only when being exercised under sonar, with VerifyError exceptions: java.lang.VerifyError: Expecting a stackmap frame at branch target 51 in method com.mycompany.AppenderBase.getMessage(Lch/qos/logback/classic/spi/ILoggingEvent;)Ljava/lang/String; at offset 27 at com.mycompany.AppenderBaseBaseTest.createStandardTestObject(AppenderBaseTest.java:32) at com.mycompany.AppenderBaseTest.log(AppenderBaseTest.java:255) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110) at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:172) at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:104) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:70)a I found some resources on stackoverflow indicating workarounds, but I would like to know 1. Presumably this is caused by a 3rd party plugin that maven-sonar-plugin uses. Most likely cobertura. How could I confirm the exact 3rd party plugin causes the problem? 2. I tried passing -XX:-UseSplitVerifier as the MAVEN_OPTS parameter but tests still failed with the same error. Do you happen to know why this happens? Is it a problem on the sonar plugin side, or maybe cobertura/surefire that did not pick it up? 3. The only way I could make it work was to add the -XX:-UseSplitVerifier option to the surefire plugin. But I would prefer not to add this option just to make sonar plugin happy. Does anyone have any other solutions/workarounds? My sonar environment is: - Sonar server version: 3.0 - Sonar pluginn: org.codehaus.mojo:sonar-maven-plugin:2.0 - The project is built on Fedora 16, with Maven 3.0.4 and JDK 1.7.0 u4 Thank you! Horace |
|
Hi,
Which coverage engine do you use?
On Mon, Jun 25, 2012 at 7:58 PM, hc <[hidden email]> wrote: Hello, Best regards, Evgeny Mandrikov aka Godin <http://godin.net.ru> http://twitter.com/_godin_ |
|
Hello Evgeny,
We are using the default code coverage plugin which is cobertura. Best Regards, Horace |
|
So most probably you face well-known issue - Cobertura doesn't play well with Java 7. Thus could you please try with JaCoCo ?
On Mon, Jun 25, 2012 at 8:53 PM, hc <[hidden email]> wrote: Hello Evgeny, Best regards, Evgeny Mandrikov aka Godin <http://godin.net.ru> http://twitter.com/_godin_ |
| Powered by Nabble | Edit this page |
