QuarkusIntegrationTest fails with ClassCastException
See original GitHub issueDescribe 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:
- Created 2 years ago
- Comments:15 (9 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
NativeAccountResourceTest
should be renamed toNativeAccountResourceIT
If it worked, it worked by chance.
Correct