cucumber-jvm: cucumber-java8 fails on OpenJDK 1.8.0

Cucumber-Java8 depends on internals of the implementation of Oracle’s JDK8. When I started experimenting with it I just always got the following exception:

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.056 sec <<< FAILURE! - in soy.wimmer.CucumberIT
Feature: Cucumber with Java8  Time elapsed: 0.047 sec  <<< ERROR!            
cucumber.runtime.CucumberException: Failed to instantiate class soy.wimmer.CucumberStepdefs
[…]                                                                          
Caused by: java.lang.reflect.InvocationTargetException: null                 
[…]                                                                          
Caused by: cucumber.runtime.CucumberException: java.lang.IllegalArgumentException: Wrong type at constant pool index
[…]                                                                          
Caused by: java.lang.IllegalArgumentException: Wrong type at constant pool index
    at sun.reflect.ConstantPool.getMemberRefInfoAt0(Native Method)           
    at sun.reflect.ConstantPool.getMemberRefInfoAt(ConstantPool.java:47)     
    at cucumber.runtime.java8.ConstantPoolTypeIntrospector.getTypeString(ConstantPoolTypeIntrospector.java:37)
    at cucumber.runtime.java8.ConstantPoolTypeIntrospector.getGenericTypes(ConstantPoolTypeIntrospector.java:27)
    at cucumber.runtime.java.Java8StepDefinition.<init>(Java8StepDefinition.java:45)
    at cucumber.runtime.java.JavaBackend.addStepDefinition(JavaBackend.java:162)
    at cucumber.api.java8.En.Given(En.java:190)                              
    at soy.wimmer.CucumberStepdefs.<init>(CucumberStepdefs.java:8)           
[…]

The test project causing this output is available at https://github.com/mawis/cucumber-java8-test

While it fails on OpenJDK8 it works without problems on Oracle JDK8. I consider this to be a bug, as I don’t think that cucumber should depend on a specific implementation of the compiler.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 63 (32 by maintainers)

Commits related to this issue

Most upvoted comments

@Grief Hopefully a 1.2.5-version will not have to wait to far into the future, but #1034 is better fixed before that. Until then the latest build on the master is available as a snapshot release.