Rest-assured: java 14 - does not work - Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7

Created on 11 Feb 2020  路  5Comments  路  Source: rest-assured/rest-assured

I have tried to test it under OpenJDK 14 ea 34 with error: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7

Update the groovy dependency? Maybe: https://issues.apache.org/jira/browse/GROOVY-8843

I have got this call stack:
麓麓麓
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
at org.codehaus.groovy.vmplugin.VMPluginFactory.(VMPluginFactory.java:43)
at org.codehaus.groovy.reflection.GroovyClassValueFactory.(GroovyClassValueFactory.java:35)
at org.codehaus.groovy.reflection.ClassInfo.(ClassInfo.java:107)
at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:95)
at org.codehaus.groovy.reflection.ReflectionCache.(ReflectionCache.java:39)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerMethods(MetaClassRegistryImpl.java:210)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.(MetaClassRegistryImpl.java:108)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.(MetaClassRegistryImpl.java:86)
at groovy.lang.GroovySystem.(GroovySystem.java:36)
at org.codehaus.groovy.runtime.InvokerHelper.(InvokerHelper.java:86)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.createMap(ScriptBytecodeAdapter.java:635)
at io.restassured.internal.ResponseParserRegistrar.(ResponseParserRegistrar.groovy)
at io.restassured.RestAssured.(RestAssured.java:347)
....
麓麓麓

Most helpful comment

I'm having the same issue and I see that my project use io.rest-assured:rest-assured:4.3.0 however, maven seem to see that 4.3.0 depends on org.codehaus.groovy:groovy:2.5.9 instead of groovy 3.0.2.

After investigation, there is a conflict in my project when resolving groovy.version. For me the conflict was with spring-boot-dependencies which was setting groovy.version to 2.5.9.

All 5 comments

FYI for the curious reader - I just upgraded to rest-assured version 4.3.0 and I no longer see these failures with Java 14 GA.

@johny2000uwb perhaps worth another try with the latest version:

https://github.com/rest-assured/rest-assured/releases/tag/rest-assured-4.3.0

same here. used 4.1.2 before and had the same NoClassDefFoundError. After upgrading to 4.3.0 the failre didn't occur anymore.

Yes it's always a good idea to upgrade :)

REST Assured has automatic builds on Java 14, see https://github.com/rest-assured/rest-assured/blob/master/.travis.yml.

I'm having the same issue and I see that my project use io.rest-assured:rest-assured:4.3.0 however, maven seem to see that 4.3.0 depends on org.codehaus.groovy:groovy:2.5.9 instead of groovy 3.0.2.

After investigation, there is a conflict in my project when resolving groovy.version. For me the conflict was with spring-boot-dependencies which was setting groovy.version to 2.5.9.

Was this page helpful?
0 / 5 - 0 ratings