-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Hibernate-Reactive: ClassCastException EmbeddableInitializerImpl to ReactiveInitializer #43326
Comments
/cc @DavideD (hibernate-reactive), @gavinking (hibernate-reactive) |
It’s a bug:
hibernate/hibernate-reactive#1979
quarkus-bot[bot] ***@***.***> schrieb am Mo. 16. Sep. 2024 um
23:21:
… /cc @DavideD <https://github.com/DavideD> (hibernate-reactive), @gavinking
<https://github.com/gavinking> (hibernate-reactive)
—
Reply to this email directly, view it on GitHub
<#43326 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEIQ5MXZEYMWGYZPTLS6UTZW5DWVAVCNFSM6AAAAABOKDXKCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJUGA2TINRRGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This should be fixed by #43348 |
Any chance to have this backported to 3.15? |
is anybody still facing the issue? Because I am still facing the same problem in v3.15.x and v3.17.x and my code is similar to what is described in this issue. |
It's possible that you've found an entity mapping that's causing the same exception. If you can provide a test case, I will have a look. |
After upgrading an API to Quarkus
|
If you want some help with this issue, copying and pasting the stacktrace is not enough. In Hibernate Reactive, we have this test case for embeddables: https://github.com/hibernate/hibernate-reactive/blob/aa5dd855a296bb28fcae6fc4d0593bac98287a28/hibernate-reactive-core/src/test/java/org/hibernate/reactive/EmbeddedIdTest.java#L27 What are you doing differently? |
I understand. Unfortunately trying to reproduce the issue with as little code as possible and without any proprietary code is not a small task for a large project. I just wanted to share some technical information in case that helped limit things down while keeping the conversation going about there probably being a related problem still lingering. I'll do what I can to help contribute more information if time permits. The project I'm trying to upgrade has automated Quarkus integration tests that should invoke the erroring code against a mock database; those pass fine. But a native build of the project running in the context of a larger system fails that same code path. It could just be that my integration test isn't a full representation of what is happening on a real system but my gut tells me something about the project running native has an impact on this error occurring... but this is all spitballing until I have the time to dig in for more details. |
I've adapted one of the quickstarts so that it uses an entity with an embedded id: DavideD/quarkus-quickstarts@d32cffe I've tested it manually and it seems to work fine in native and non native mode. Not sure how many entities you are dealing with, but this error happens on entities with an embedded id. So, it shouldn't be too hard to update it to at least try a mapping similar to the one you have. I don't think this errors is caused by the amount of fields, most likely you are fetching a collections of entities having an embedded id as a result of some query. By the way, it shouldn't matter, but it might be helpful to know which database you are using. |
Quick update here this morning. I've now been able to reproduce the Hibernate error in an integration test. It isn't native specific; the native path I was able to test quickly yesterday just had slightly more data on the record that wasn't included in the simpler JVM path. The This API is quite dense: lots of entities, lots of fields per entity, and lots of nested relationships. It can just be slow to get to the heart of the matter in a project like this especially when maintenance isn't a top priority. I'm sure you can understand. This API seems to return entities that share a parent class that has an embedded ID. Some entities have nested collections of other entities with the same parent class. I think that matches the description above. I'm going to try and reproduce this setup by forking the quick start as you had. Hopefully that comes together quickly and I'll have something actually useful for you to look into. |
Thanks for feedback and for looking into this. |
I`m having the same problem, how can i force to use the reactive implementation instead normal one (EmbeddableInitializerImpl)? |
Could you provide a test case? Or at least gives some details about your use case? |
I will, i`m doing this right now. |
Great, thanks |
@DavideD: I think I've got an error reproducible when you have the time to dig into it. I forked the quickstart repo at |
Would it make sense to reopen this issue yet? If you all need more time to verify the linked case is indeed highlighting a bug that is fine. Just wanted to make sure this discussion didn't get lost over the holidays. |
If you're worried this will get lost, I'd suggest opening a dedicated issue, preferably at https://github.com/hibernate/hibernate-reactive/ , linking to this conversation and the reproducer. |
I'm having a look now |
I've adapted the test case for Hibernate Reactive and created the following issue: hibernate/hibernate-reactive#2060 |
Describe the bug
When migration from Quarkus 3.13.3 to any quarkus 3.14.X version a classe cast expression occured when using @Embeddable/@EmbeddedId.
Expected behavior
No exception should be thrown.
Actual behavior
How to Reproduce?
My code is simple.
Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
3.14.4
Build tool (ie. output of
mvnw --version
orgradlew --version
)mvn 3.9.5
Additional information
Work around: Use @IdClass
The text was updated successfully, but these errors were encountered: