1 Reply Latest reply on Jan 24, 2017 11:25 AM by Donato Marrazzo

    Runtime error "Method code too large!" when running jacoco Code Coverage at ProcessBuilderImpl.buildProcess(ProcessBuilderImpl.java:140)

    Chris Lambrou Newbie

      Hi,

      We are getting an error when running jacoco Code Coverage using maven 3.0 and jbpm-test 6.3.0.

      Please see the stack trace below.  It seems that jacoco fails instrumenting org.jbpm.compiler.ProcessBuilderImpl.buildProcess(ProcessBuilderImpl.java:140)

      We are working with jbpm-test 6.3.0 and Jacoco 0.7.8. Any ideas how to bypass this error, apart from commenting out the test?

       

      Jan 22, 2017 10:59:39 AM org.dtph.bus.jbpm.search.ProcessInstanceSearcher abortParentProcessAndSubprocesses

      INFO: Aborting processInstance 0,with deploymentIddtph:DevelopmentControl:1.0

      java.lang.instrument.IllegalClassFormatException: Error while instrumenting class org/drools/compiler/lang/DRL6Lexer.

        at org.jacoco.agent.rt.internal_e5875b2.CoverageTransformer.transform(CoverageTransformer.java:93)

        at sun.instrument.TransformerManager.transform(TransformerManager.java:188)

        at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)

        at java.lang.ClassLoader.defineClass1(Native Method)

        at java.lang.ClassLoader.defineClass(ClassLoader.java:760)

        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)

        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

        at org.drools.compiler.compiler.DRLFactory.getDRLLexer(DRLFactory.java:112)

        at org.drools.compiler.compiler.DRLFactory.buildLexer(DRLFactory.java:51)

        at org.drools.compiler.compiler.DrlParser.parse(DrlParser.java:81)

        at org.drools.compiler.compiler.DrlParser.parse(DrlParser.java:88)

        at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.addPackageFromDrl(KnowledgeBuilderImpl.java:356)

        at org.jbpm.compiler.ProcessBuilderImpl.buildProcess(ProcessBuilderImpl.java:140)

        at org.jbpm.compiler.ProcessBuilderImpl.addProcessFromXml(ProcessBuilderImpl.java:288)

        at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.addProcessFromXml(KnowledgeBuilderImpl.java:677)

        at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.addKnowledgeResource(KnowledgeBuilderImpl.java:730)

        at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:2223)

        at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:2212)

        at org.jbpm.runtime.manager.impl.SimpleRuntimeEnvironment.addAsset(SimpleRuntimeEnvironment.java:162)

        at org.jbpm.runtime.manager.impl.RuntimeEnvironmentBuilder.addAsset(RuntimeEnvironmentBuilder.java:341)

        at org.jbpm.runtime.manager.impl.RuntimeEnvironmentBuilder.addAsset(RuntimeEnvironmentBuilder.java:74)

        at org.jbpm.test.JbpmJUnitBaseTestCase.createRuntimeManager(JbpmJUnitBaseTestCase.java:451)

        at org.jbpm.test.JbpmJUnitBaseTestCase.createRuntimeManager(JbpmJUnitBaseTestCase.java:314)

        at org.dtph.bus.timer.controllers.WorkflowStarterControllerTest.testHousingExpenseDiagram(WorkflowStarterControllerTest.java:93)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:497)

        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)

        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)

        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)

        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)

        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)

        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)

        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)

        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)

        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)

        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)

        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)

        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)

        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)

        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)

        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)

        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:497)

        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(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)

      Caused by: java.io.IOException: Error while instrumenting class org/drools/compiler/lang/DRL6Lexer.

        at org.jacoco.agent.rt.internal_e5875b2.core.instr.Instrumenter.instrumentError(Instrumenter.java:160)

        at org.jacoco.agent.rt.internal_e5875b2.core.instr.Instrumenter.instrument(Instrumenter.java:111)

        at org.jacoco.agent.rt.internal_e5875b2.CoverageTransformer.transform(CoverageTransformer.java:91)

        ... 62 more

      Caused by: java.lang.RuntimeException: Method code too large!

        at org.jacoco.agent.rt.internal_e5875b2.asm.MethodWriter.getSize(MethodWriter.java:2036)

        at org.jacoco.agent.rt.internal_e5875b2.asm.ClassWriter.toByteArray(ClassWriter.java:827)

        at org.jacoco.agent.rt.internal_e5875b2.core.instr.Instrumenter.instrument(Instrumenter.java:85)

        at org.jacoco.agent.rt.internal_e5875b2.core.instr.Instrumenter.instrument(Instrumenter.java:108)

        ... 63 more

      Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.497 sec