我使用 jdk 1.7、jekins、maven,当我构建项目时,单元测试失败,错误是:
java.lang.VerifyError: Expecting a stackmap frame at branch target 73 异常详细信息:位置:com/DataDictDao.save(Lcom/DataDict;)Ljava/lang/Long; @25:ldc 原因:此位置的预期堆栈图帧。Bytecode: 0000000: 033d 11ff ff3e 1212 1100 25b8 0018 2ab4 0000010: 0022 122d b900 3302 0012 1211 0027 b800 0000020: 182a b400 352b b900 3a02 0012 1211 0028 0000030: b800 182a b400 2212 3cb9 0033 0200 1212 0000040: 1100 2cb8 0018 a700 2d12 1211 0029 b800 0000050: 183a 0412 1211 002a b800 182a b400 2212 0000060: 3e19 04b9 0042 0300 1212 1100 2bb8 0018 0000070: 1904 bf12 1211 002d b800 182b b600 48b8 0000080: 004e b0 Exception Handler Table: bci [25, 62] => handler: 73 堆栈图表:
在 java.lang.Class.getDeclaredConstructors0(Native Method) 在 java.lang.Class.privateGetDeclaredConstructors(Class.java:2493) 在 java.lang.Class.getDeclaredConstructors(Class.java:1901) 在 org.springframework.beans.factory .annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:231) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1002) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.AbstractAutowireCapableBeanFactory. .java:975) 在 org.springframework.beans.factory 的 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487)。support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry .java:223) 在 org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) 在 org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293) 在 org. springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628) 在 org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) 在 org.springframework。context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:120) at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext( AbstractGenericContextLoader.java:60) at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100) at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:248) at org .springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64) 在 org.springframework.test.context.CacheAwareContextLoaderDelegate。loadContext(CacheAwareContextLoaderDelegate.java:91) at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:122) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:105) at org .springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:74) 在 org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:312) 在 org.springframework.test.context.junit4.SpringJUnit4ClassRunner org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) 在 org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231) 在 org.springframework.test 的 org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:284) .context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63 ) 在 org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) 在 org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) 在 org.junit.runners.ParentRunner$2.evaluate(ParentRunner. java:229) 在 org.springframework.test 的 org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)。context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner. java:174) 在 org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) 在 org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) 在 org.apache .maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 在 sun.reflect.DelegatingMethodAccessorImpl org.apache.maven 的 java.lang.reflect.Method.invoke(Method.java:606) 的 .invoke(DelegatingMethodAccessorImpl.java:43)。Surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) 在 org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) 在 org.apache.maven.surefire.booter.ProviderFactory。 invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)ForkedBooter.main(ForkedBooter.java:75)ForkedBooter.main(ForkedBooter.java:75)
我在 maven MAVEN_OPTS 中尝试了 -noverify 和 -XX:-UseSplitVerifier,都没有成功,谁能告诉我为什么会出现这个错误,如何解决?