Error Handling : java.lang.VerifyError: Expecting a stackmap frame

If you are struggling with the following kind of error

java.lang.VerifyError: Expecting a stackmap frame at branch target 6 bla bla bla …

then a simple solution is to add the following default JVM argument -XX:-UseSplitVerifier

If you are doing it in eclipse, like i was, then goto Window -> Preferences -> Installed JREs -> and add the default parameter.

If may want to add it to the sure fire plugin in pom.xml

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <forkMode>once</forkMode>
                        <argLine>-Xms512m -Xmx512m -XX:-UseSplitVerifier</argLine>
                    </configuration>
                </plugin>               

 

Detailed stack trace :                
——————————————————-
T E S T S
——————————————————-
Running TestSuite

===============================================
Suite1
Total tests run: 0, Failures: 0, Skips: 0
===============================================

org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.In
vocationTargetException; nested exception is java.lang.reflect.InvocationTargetE
xception: null
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(
ReflectionUtils.java:189)
        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke
(ProviderFactory.java:165)
        at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(Provi
derFactory.java:85)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(Fork
edBooter.java:115)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:
75)
Caused by: java.lang.VerifyError: Expecting a stackmap frame at branch target 24
in method com.ptc.fusion.model.learningitem.AbstractLearningItem.JiBX_LearningI
tem_binding_unmarshal_1_0(Lorg/jibx/runtime/impl/UnmarshallingContext;)Lcom/ptc/
fusion/model/learningitem/AbstractLearningItem; at offset 16
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
        at java.lang.Class.privateGetPublicMethods(Class.java:2562)
        at java.lang.Class.getMethods(Class.java:1427)
        at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:5
4)
        at org.testng.TestRunner.initMethods(TestRunner.java:289)
        at org.testng.TestRunner.init(TestRunner.java:235)
        at org.testng.TestRunner.init(TestRunner.java:197)
        at org.testng.TestRunner.<init>(TestRunner.java:141)
        at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRu
nner.java:488)
        at org.testng.SuiteRunner.privateRun(SuiteRunner.java:250)
        at org.testng.SuiteRunner.run(SuiteRunner.java:204)
        at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
        at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
        at org.testng.TestNG.run(TestNG.java:751)
        at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.ja
va:178)
        at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXml
TestSuite.java:92)
        at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider
.java:96)
        … 9 more

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ————————————————————————
[INFO] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Total time: 1:04.074s
[INFO] Finished at: Wed Mar 13 11:40:05 IST 2013
[INFO] Final Memory: 39M/295M
[INFO] ————————————————————————
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.
12.4:test (default-test) on project fusion-service: Execution default-test of go
al org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked
VM terminated without saying properly goodbye. VM crash or System.exit called ?
-> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutio
nException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :fusion-service

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s