Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflicting versions of Groovy on the classpath bug #3101

Open
axiopisty opened this issue Mar 27, 2023 · 1 comment
Open

Conflicting versions of Groovy on the classpath bug #3101

axiopisty opened this issue Mar 27, 2023 · 1 comment
Labels

Comments

@axiopisty
Copy link

axiopisty commented Mar 27, 2023

Hello good people. Thank you for a wonderful product!

I would like to report what I think is a problem or a bug. If it is neither, and I am just doing something wrong, please advise. I'd appreciate hearing from you either way.

Here is the pertinent output from the command mvn dependency:tree on my project, in which I am trying to use Serenity-BDD with serenity-rest-assured.


[INFO] +- net.serenity-bdd:serenity-rest-assured:jar:3.6.21:test
[INFO] | +- io.rest-assured:rest-assured:jar:4.5.1:test
[INFO] | | +- org.codehaus.groovy:groovy:jar:3.0.13:test
[INFO] | | +- org.codehaus.groovy:groovy-xml:jar:3.0.13:test
[INFO] | | +- org.apache.httpcomponents:httpmime:jar:4.5.14:test
[INFO] | | +- org.ccil.cowan.tagsoup:tagsoup:jar:1.2.1:test
[INFO] | | +- io.rest-assured:json-path:jar:4.5.1:test
[INFO] | | | +- org.codehaus.groovy:groovy-json:jar:3.0.13:test
[INFO] | | | - io.rest-assured:rest-assured-common:jar:4.5.1:test
[INFO] | | - io.rest-assured:xml-path:jar:4.5.1:test
[INFO] | +- org.apache.groovy:groovy-json:jar:4.0.10:test
[INFO] | +- org.apache.groovy:groovy-xml:jar:4.0.10:test
[INFO] | - org.opentest4j:opentest4j:jar:1.2.0:test


Notice that serenity-rest-assured defines conflicting transitive dependencies on the groovy libraries. When I build my project and try to do a simple get request for an application health check maven reports the following issue:


TLDR (Full Stack Trace):
Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-xml is loaded in version 3.0.13 and you are trying to load version 4.0.10


Full Stack Trace:
[ERROR] Application Health Check Feature.osp-product-service health check Time elapsed: 0.411 s <<< ERROR!
net.serenitybdd.core.exceptions.SerenityManagedException
at org.codehaus.groovy.reflection.ClassInfo.isValidWeakMetaClass(ClassInfo.java:283)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClassForClass(ClassInfo.java:253)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:309)
at io.restassured.authentication.NoAuthScheme.$getStaticMetaClass(NoAuthScheme.groovy)
at io.restassured.authentication.NoAuthScheme.(NoAuthScheme.groovy)
at io.restassured.RestAssured.(RestAssured.java:355)
at .productservice.integration.tests.glue.AutomationRestClient.configureBaseUri(AutomationRestClient.java:403)
at .productservice.integration.tests.glue.AutomationRestClient.invokeRequest(AutomationRestClient.java:82)
at .productservice.integration.tests.glue.AutomationRestClient$ByteBuddy$cvI2DqFy.invokeRequest$accessor$SqY4eio1(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at net.thucydides.core.steps.BaseMethodRunner.invokeMethod(BaseMethodRunner.java:18)
at net.thucydides.core.steps.NormalMethodRunner.invokeMethodAndNotifyFailures(NormalMethodRunner.java:18)
at net.thucydides.core.steps.StepInterceptor.runNormalMethod(StepInterceptor.java:421)
at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:193)
at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:86)
at net.thucydides.core.steps.ProxyConfiguration$InterceptorDispatcher.intercept(ProxyConfiguration.java:51)
at .productservice.integration.tests.glue.AutomationRestClient$ByteBuddy$cvI2DqFy.invokeRequest(Unknown Source)
at .productservice.integration.tests.glue.GenericStepDefinitions.whenMethodPath(GenericStepDefinitions.java:54)
at ✽.GET /health(file:///Users//osp-product-service/osp-product-service-integration-tests/src/test/resources/features/application/health-check.feature:4)
Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-xml is loaded in version 3.0.13 and you are trying to load version 4.0.10
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$DefaultModuleListener.onModule(MetaClassRegistryImpl.java:524)
at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromProperties(ExtensionModuleScanner.java:87)
at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromMetaInf(ExtensionModuleScanner.java:81)
at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanClasspathModulesFrom(ExtensionModuleScanner.java:63)
at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanClasspathModules(ExtensionModuleScanner.java:54)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.(MetaClassRegistryImpl.java:133)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.(MetaClassRegistryImpl.java:94)
at groovy.lang.GroovySystem.(GroovySystem.java:37)
at org.codehaus.groovy.reflection.ClassInfo.isValidWeakMetaClass(ClassInfo.java:283)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClassForClass(ClassInfo.java:253)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:309)
at io.restassured.authentication.NoAuthScheme.$getStaticMetaClass(NoAuthScheme.groovy)
at io.restassured.authentication.NoAuthScheme.(NoAuthScheme.groovy)
at io.restassured.RestAssured.(RestAssured.java:355)
at .productservice.integration.tests.glue.AutomationRestClient.configureBaseUri(AutomationRestClient.java:403)
at .productservice.integration.tests.glue.AutomationRestClient.invokeRequest(AutomationRestClient.java:82)
at .productservice.integration.tests.glue.AutomationRestClient$ByteBuddy$cvI2DqFy.invokeRequest$accessor$SqY4eio1(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at net.thucydides.core.steps.BaseMethodRunner.invokeMethod(BaseMethodRunner.java:18)
at net.thucydides.core.steps.NormalMethodRunner.invokeMethodAndNotifyFailures(NormalMethodRunner.java:18)
at net.thucydides.core.steps.StepInterceptor.runNormalMethod(StepInterceptor.java:421)
at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:193)
at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:86)
at net.thucydides.core.steps.ProxyConfiguration$InterceptorDispatcher.intercept(ProxyConfiguration.java:51)
at .productservice.integration.tests.glue.AutomationRestClient$ByteBuddy$cvI2DqFy.invokeRequest(Unknown Source)
at .productservice.integration.tests.glue.GenericStepDefinitions.whenMethodPath(GenericStepDefinitions.java:54)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at io.cucumber.java.Invoker.doInvoke(Invoker.java:66)
at io.cucumber.java.Invoker.invoke(Invoker.java:24)
at io.cucumber.java.AbstractGlueDefinition.invokeMethod(AbstractGlueDefinition.java:47)
at io.cucumber.java.JavaStepDefinition.execute(JavaStepDefinition.java:29)
at io.cucumber.core.runner.CoreStepDefinition.execute(CoreStepDefinition.java:66)
at io.cucumber.core.runner.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:63)
at io.cucumber.core.runner.ExecutionMode$1.execute(ExecutionMode.java:10)
at io.cucumber.core.runner.TestStep.executeStep(TestStep.java:84)
at io.cucumber.core.runner.TestStep.run(TestStep.java:56)
at io.cucumber.core.runner.PickleStepTestStep.run(PickleStepTestStep.java:51)
at io.cucumber.core.runner.TestCase.run(TestCase.java:84)
at io.cucumber.core.runner.Runner.runPickle(Runner.java:75)
at io.cucumber.junit.PickleRunners$NoStepDescriptions.lambda$run$0(PickleRunners.java:151)
at io.cucumber.core.runtime.CucumberExecutionContext.lambda$runTestCase$5(CucumberExecutionContext.java:130)
at io.cucumber.core.runtime.RethrowingThrowableCollector.executeAndThrow(RethrowingThrowableCollector.java:23)
at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:130)
at io.cucumber.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:148)
at io.cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:144)
at io.cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:28)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at io.cucumber.junit.FeatureRunner.run(FeatureRunner.java:137)
at io.cucumber.junit.CucumberSerenityBaseRunner.runChild(CucumberSerenityBaseRunner.java:330)
at io.cucumber.junit.CucumberSerenityBaseRunner.runChild(CucumberSerenityBaseRunner.java:51)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at io.cucumber.junit.CucumberSerenityBaseRunner$RunCucumber.evaluate(CucumberSerenityBaseRunner.java:361)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:42)
at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80)
at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:72)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)


In case this is helpful, here is my environment information:

Apache Maven 3.8.7 (b89d5959fcde851dcb1c8946a785a163f14e1e29)
Maven home: /Users//.sdkman/candidates/maven/current
Java version: 17.0.5, vendor: Azul Systems, Inc., runtime: /Users//.sdkman/candidates/java/17.0.5.fx-zulu/zulu-17.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "13.2.1", arch: "aarch64", family: "mac"

@wakaleo
Copy link
Member

wakaleo commented Mar 28, 2023

It's a dependency conflict in your project, but it's not coming from the Serenity dependencies. Something else in your project has a dependency on Groovy 3.0.13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants