cancel
Showing results for 
Search instead for 
Did you mean: 

Error occurred while running Spock tests: java.lang.ClassFormatError: Illegal method name

0 Kudos

Hi guys,

After migration from hybris 4.8 to 5.4 we have faced with an issue while running tests like:

 $ ant alltests 

Since we have Spock tests that have non-standard method names (with spaces) we got the following:

 BUILD FAILED
 /app/hybris/bin/platform/build.xml:257: The following error occurred while executing this line:
 /app/hybris/bin/platform/resources/ant/testing.xml:93: java.lang.ClassFormatError: Illegal method name "should not allow null tenderPaymentInfo parameter for savePaymentData(..) operation" in class xx/xxxxxx/xxxxx/payment/impl/CtfsPaymentInfoServiceTest
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
         at groovy.lang.GroovyClassLoader.access$300(GroovyClassLoader.java:56)
         at groovy.lang.GroovyClassLoader$ClassCollector.createClass(GroovyClassLoader.java:478)
         at groovy.lang.GroovyClassLoader$ClassCollector.onClassNode(GroovyClassLoader.java:495)
         at groovy.lang.GroovyClassLoader$ClassCollector.call(GroovyClassLoader.java:499)
         at org.codehaus.groovy.control.CompilationUnit$16.call(CompilationUnit.java:814)
         at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1047)
         at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:583)
         at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:561)
         at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:538)
         at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:286)
         at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:259)
         at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:245)
         at groovy.lang.GroovyClassLoader.recompile(GroovyClassLoader.java:739)
         at de.hybris.bootstrap.testclasses.PatchedForTestGroovyClassLoader.loadClass(PatchedForTestGroovyClassLoader.java:132)
         at de.hybris.bootstrap.testclasses.PatchedForTestGroovyClassLoader.loadClass(PatchedForTestGroovyClassLoader.java:39)
         at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:753)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:274)
         at de.hybris.bootstrap.testclasses.TestClassesUtil.getClassFromClassLoader(TestClassesUtil.java:908)
         at de.hybris.bootstrap.testclasses.TestClassesUtil.getClassForName(TestClassesUtil.java:900)
         at de.hybris.bootstrap.testclasses.TestClassesUtil.convertToTestClasses(TestClassesUtil.java:741)
         at de.hybris.bootstrap.testclasses.TestClassesUtil.getAllTestClassesForExtension(TestClassesUtil.java:626)
         at de.hybris.bootstrap.testclasses.TestClassesUtil.scan(TestClassesUtil.java:403)
         at de.hybris.bootstrap.testclasses.TestClassesUtil.getFilteredTestClasses(TestClassesUtil.java:346)
         at de.hybris.ant.taskdefs.TestClassesUtilTask.execute(TestClassesUtilTask.java:174)
         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
         at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:606)
         at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
         at org.apache.tools.ant.Task.perform(Task.java:348)
         at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
         at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:606)
         at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
         at org.apache.tools.ant.Task.perform(Task.java:348)
         at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
         at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:606)
         at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
         at org.apache.tools.ant.Task.perform(Task.java:348)
         at org.apache.tools.ant.Target.execute(Target.java:435)
         at org.apache.tools.ant.Target.performTasks(Target.java:456)
         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
         at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
         at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
         at org.apache.tools.ant.Main.runBuild(Main.java:851)
         at org.apache.tools.ant.Main.startAnt(Main.java:235)
         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
 
 Total time: 18 seconds


Can anyone help me out with this problem?
Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Resolved. The problem was with symbol '.' in name of the method.

But I have another issue:

 /app/hybris/bin/platform/build.xml:257: The following error occurred while executing this line:
 /app/hybris/bin/platform/resources/ant/testing.xml:93: java.lang.VerifyError: (class: xx/xxxxx/xxxxxx/payment/impl/CtfsPaymentInfoServiceTest, method: should not allow null cart parameter for savePaymentData(x,x) operation signature: ()Ljava/lang/Object;) Stack size too large

Changing the method's name to standard one (eg shouldTest) does not have effect...