General error during class generation: Method code too large! on 6.0.5


#1

I was running the same test case successfully in 5.9.1 after upgrading to latest 6.0.5 I started getting these errors…

03-11-2019 12:48:33 PM status = statusCode.verify_statusCode.verify201(response, request)

Elapsed time: 0.027s

statusCode.verify_statusCode.:1

status = statusCode.verify_statusCode.verify201(response, request) FAILED.
Reason:
java.lang.Error: Unresolved compilation problem: **
** General error during class generation: Method code too large!

java.lang.RuntimeException: Method code too large!
at groovyjarjarasm.asm.MethodWriter.a(Unknown Source)
at groovyjarjarasm.asm.ClassWriter.toByteArray(Unknown Source)
at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:890)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1188)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:653)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:631)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:608)
at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.processToPhase(GroovyCompilationUnitDeclaration.java:214)
at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.generateCode(GroovyCompilationUnitDeclaration.java:326)
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:931)
at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:141)
at java.lang.Thread.run(Thread.java:748)

at statusCode.verify_statusCode.<init>(verify_statusCode.groovy:1)
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:45)
at Central-Login-Token.run(Central-Login-Token:24)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:331)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:322)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:301)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:293)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:227)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1552261706992.run(TempTestCase1552261706992.groovy:21)

#2

OK That’s weird :thinking: but I managed to resolve this issue by following steps:

  1. Open keywords files.
  2. If you have import internal.GlobalVariable in the import list then remove it.
  3. Save file
  4. Now import GlobalVariable again (import internal.GlobalVariable) and save.

Now the scripts are working fine on the latest build.