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

Need an advice on the error - net.serenitybdd.core.exceptions.SerenityManagedException #2430

Closed
LalithaRajesh06 opened this issue Apr 13, 2021 · 5 comments

Comments

@LalithaRajesh06
Copy link

LalithaRajesh06 commented Apr 13, 2021

image

image

Hi Team,

My name is Lalitha and I am a QA Automation Engineer . I have upgraded my pom.xml file recently to use maven-failsafe-plugin instead of temyers/cucumber-jvm-parallel-plugin. After I upgraded it, I started getting the following error mentioned below. For a sanity check, I had tested the same code in the lower version (to the previous version before I moved my changes), it was running successfully. I could not figure anything exactly more on this error.

Error details:
17:06:37.209 [main] INFO - STEP ERROR: net.serenitybdd.core.exceptions.SerenityManagedException: Receiver class net.serenitybdd.rest.decorators.ResponseSpecificationDecorated$ByteBuddy$d1qolyPM does not define or inherit an implementation of the resolved method abstract body(Ljava/lang/String;Lorg/hamcrest/Matcher;[Ljava/lang/Object;)Lio/restassured/specification/ResponseSpecification; of interface io.restassured.specification.ResponseSpecification.

The steps I had taken to resolve:

  1. Tried adding byteBuddy dependency
  2. my current serenity version is 2.3.12. Tried changing that to 2.4.1 as well. I suspected that there would be a version mismatch between serenity and hamcrest. However, it did not work even after I used the recent serenity version..
  3. I deleted the java package folder(com) inside the repositories under .m2 folder. Then tried to maven clean install.

However all these steps did not provide any effect.

Please can some one help me on this issue. Any help on this would really be appreciated.
Thank you,
Lalitha Rajesh

@wakaleo
Copy link
Member

wakaleo commented Apr 13, 2021

Looks like a version conflict with an incompatible version of rest assured.

@LalithaRajesh06
Copy link
Author

LalithaRajesh06 commented Apr 14, 2021

Thanks John. I have few doubts on the version conflict.

My previous serenity version was 2.2.9. Now, I have upgraded to 2.3.12. On looking into the above error, we have a java library called bytebuddy. I understand that bytebuddy will automatically get some reflections of the code like providing an implementation for interfaces or abstract methods automatically. So, while we are using 2.2.9, it was able to use those decorations easily I believe. However after upgrading to 2.3.12, for some reason, it is not able to do the io.restassured related abstract methods.

image

Internally on the code, this is the place where I see the serenityManagedException error.

On my perspective When this except() is being called, the serenity BDD rest assured internally calls io.resassured response specifications only. Hence it is not able to get the classes that it is looking for.

When we take a closer look on https://javadoc.io/doc/io.rest-assured/rest-assured/3.0.5/io/restassured/specification/ResponseSpecification.html#expect-- , it returns a response specification. Similarly, when we take a look at https://javadoc.io/doc/net.serenity-bdd/serenity-rest-assured/2.0.71/net/serenitybdd/rest/SerenityRest.html#expect-- the except method is providing the io.restassured.specification.ResponseSpecification. When this method is not built by bytebuddy, then it is not able to get that responseSpecification properly.

Hence if this assumption is correct, I tried to add the dependency like below.
image

However, I still get the same error.

Please can you advice on this further.

@wakaleo
Copy link
Member

wakaleo commented Apr 14, 2021

It's a dependency conflict with your version of rest-assured. Remove the dependencies on rest-assured in your pom.xml.

@LalithaRajesh06
Copy link
Author

Hi John,

Thanks for your message. I did not have that dependency earlier. I just added it now to understand if that makes any difference.
Any how having that dependency/ not having that dependency results in the same error.

@wakaleo
Copy link
Member

wakaleo commented Apr 14, 2021

Try doing a dependency analysis to find out where the dependency conflict is, and adding a version compatible with the latest version of Serenity (e.g. 4.3.3)

@wakaleo wakaleo closed this as completed Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants