question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

QuarkusIntegrationTest fails with ClassCastException

See original GitHub issue

Describe the bug

@QuarkusIntegrationTest may fail with the following exception

java.lang.RuntimeException: java.lang.ClassCastException: class io.quarkus.test.junit.RunningAppConfigResolver$1 cannot be cast to class io.smallrye.config.SmallRyeConfig (io.quarkus.test.junit.RunningAppConfigResolver$1 and io.smallrye.config.SmallRyeConfig are in unnamed module of loader 'app')
Caused by: java.lang.ClassCastException: class io.quarkus.test.junit.RunningAppConfigResolver$1 cannot be cast to class io.smallrye.config.SmallRyeConfig (io.quarkus.test.junit.RunningAppConfigResolver$1 and io.smallrye.config.SmallRyeConfig are in unnamed module of loader 'app')

Expected behavior

No exception, test just work.

Actual behavior

The exception is thrown, test is failing.

How to Reproduce?

IT test annotated with @QuarkusTest works without any problems but it executes everything in the same JVM. Once it changed to @QuarkusIntegrationTest sometimes it may throw this exception. Sometimes the test refuses to start Quarkus because the port is occupied (may be it has not been shutdown properly after the previous run ?)

Output of uname -a or ver

Linux, version 4.14.225-169.362.amzn2.x86_64

Output of java -version

Java 8

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.3.0.Final

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

No response

Additional information

Upgraded Quarkus version to 2.3.0 where this fix is done : https://github.com/quarkusio/quarkus/issues/20049

Now the tests are executed somehow but some tests are failing.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
geoandcommented, Jan 9, 2022

NativeAccountResourceTest should be renamed to NativeAccountResourceIT

1reaction
geoandcommented, Dec 7, 2021

It did work prior to 2.3.0.Final though. Was that a missing restriction in there? So It’s not intended to run anything other than @QuarkusIntegrationTest in the failsafe mvn verify in general or is that some restriction that could be changed?

If it worked, it worked by chance.

So It’s not intended to run anything other than @QuarkusIntegrationTest in the failsafe mvn verify in general

Correct

Read more comments on GitHub >

github_iconTop Results From Across the Web

ClassCastException in Quarkus multi-module project
I am using maven, though. I can confirm the problem do not occur when using the runner or in tests. I created a...
Read more >
Class Loading Reference - Quarkus
This loads all the -deployment artifacts and their dependencies, as well as other user dependencies. It does not load the application root or...
Read more >
Solved: Get a java.lang.ClassCastException error when usin...
Solved: Hi, I'm trying to setup an automation rule that when an issue is updated, the due date of all related linked issues...
Read more >
org.mozilla.javascript.ConsString cannot be cast to java.lang ...
IDP test connection is failing in instance & could see below saml errors in logs. SAML2: error performing test conneciton java.lang.ClassCastException: org.
Read more >
java.lang.String incompatible with com.rational.test.ft.script ...
Error: java.lang.ClassCastException: java.lang.String incompatible with com.rational.test.ft.script.State in Rational Functional Tester · Problem.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found