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

Integration tests fail due to Mixing RESTEasy Reactive and RESTEasy Classic client parts #36124

Closed
roman-svystun opened this issue Sep 25, 2023 · 12 comments · Fixed by #36134
Closed
Labels
area/rest kind/bug Something isn't working
Milestone

Comments

@roman-svystun
Copy link

Describe the bug

After #35468 if a project delares usage of quarkus-rest-client-reactive-jackson and uses testcontainers-keycloak for integration tests then Quarkus fails to start with

[error]: Build step io.quarkus.resteasy.reactive.common.deployment.ResteasyReactiveCommonProcessor#checkMixingStacks threw an exception: jakarta.enterprise.inject.spi.DeploymentException: Mixing RESTEasy Reactive and RESTEasy Classic client parts is not supported

testcontainers-keycloak happen to depend on the non-reactive resteasy-client.

Expected behavior

Mixing stacks is not enforced for dependencies with the test scope.

Actual behavior

Quarkus fails to start if test dependencies lead to mixing stacks.

How to Reproduce?

  1. Download the sample project - https://ro-events.s3.eu-central-1.amazonaws.com/quarkus-rest-reactive-issue.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJZN3BJ2KKWHLR4WA%2F20230925%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20230925T075625Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=ea0f059a8a79a76fc2c6591e7752478382c5bf2dadc39ff529eb3cecef9080b8
  2. Unpack
  3. cd quarkus-rest-reactive-issue/code-with-quarkus/
  4. mvn clean verify

Output of uname -a or ver

Linux pop-os 6.4.6-76060406-generic #202307241739169462191722.04~ac5e1a8 SMP PREEMPT_DYNAMIC Wed S x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

OpenJDK 64-Bit Server VM Corretto-17.0.4.8.1 (build 17.0.4+8-LTS, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

3.4.1

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.4 (dfbb324ad4a7c8fb0bf182e6d91b0ae20e3d2dd9)

Additional information

This issue may belong to the maintainers of testcontainers-keycloak.

@roman-svystun roman-svystun added the kind/bug Something isn't working label Sep 25, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Sep 25, 2023

/cc @FroMage (resteasy-reactive), @geoand (resteasy-reactive), @stuartwdouglas (resteasy-reactive)

@geoand
Copy link
Contributor

geoand commented Sep 25, 2023

Thanks for reporting.

Can you check and see if this issue is still present in the current main of Quarkus?

@geoand geoand added the triage/needs-feedback We are waiting for feedback. label Sep 25, 2023
@roman-svystun
Copy link
Author

Yes, the issue is still present with the version 999-SNAPSHOT:

[ERROR] Errors: 
[ERROR]   GreetingResourceTest.testHelloEndpoint » Runtime java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.resteasy.reactive.common.deployment.ResteasyReactiveCommonProcessor#checkMixingStacks threw an exception: jakarta.enterprise.inject.spi.DeploymentException: Mixing RESTEasy Reactive and RESTEasy Classic client parts is not supported
	at io.quarkus.resteasy.reactive.common.deployment.ResteasyReactiveCommonProcessor.checkMixingStacks(ResteasyReactiveCommonProcessor.java:105)

One possible workaround for Quarkus services that do not need to call Keycloak Admin APIs during tests is to exlude the KC admin client:

<dependency>
  <groupId>com.github.dasniko</groupId>
  <artifactId>testcontainers-keycloak</artifactId>
  <version>3.0.0</version>
  <scope>test</scope>
  <exclusions>
    <exclusion>
      <groupId>org.keycloak</groupId>
      <artifactId>keycloak-admin-client</artifactId>
    </exclusion>
  </exclusions>
</dependency>

@geoand
Copy link
Contributor

geoand commented Sep 25, 2023

#36134 is the fix

geoand added a commit that referenced this issue Sep 26, 2023
Allow using RESTEasy Classic test deps when app is RESTEasy Reactive app
@quarkus-bot quarkus-bot bot added this to the 3.5 - main milestone Sep 26, 2023
@debu999
Copy link
Contributor

debu999 commented Oct 3, 2023

When will this be released. Is 3.5 targetted to be released soon.

@debu999
Copy link
Contributor

debu999 commented Oct 3, 2023

This issue pop up for MongoResource Test as well.

@ToniChaz
Copy link

ToniChaz commented Oct 5, 2023

Hi guys any workaround for this? Exclude keycloak-admin-client from testcontainers-keycloak is impossible for me, because I have many tests wich uses this client.

@Alex-Wauters
Copy link

Still seeing this issue with the newly released 3.5.0, is there an estimate for which release it will target?

@geoand
Copy link
Contributor

geoand commented Oct 27, 2023

Can you attach a sample that fails?

@Alex-Wauters
Copy link

Alex-Wauters commented Nov 15, 2023

Sorry for the false alarm, it turned out we had a lingering import on an unused resteasy-multipart-provider in the pom.xml that triggered that exception for not mixing resteasy classic & reactive.

@geoand
Copy link
Contributor

geoand commented Nov 15, 2023

No problem at all.

Thanks for the update.

@milo-v
Copy link

milo-v commented Feb 18, 2025

Hello, I'm encountering this issue with quarkus 3.18.2 and testcontainers-keycloak 3.6.0. Excluding org.keycloak:keycloak-admin-client doesn't work.

EDIT: currently I'm unable to reproduce the problem with a new project. My project uses gradle, while my sample project uses maven with quarkus 3.18.3. I changed my original project to maven + quarkus 3.18.3 and the problem disappears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants