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

Hibernate-Reactive: ClassCastException EmbeddableInitializerImpl to ReactiveInitializer #43326

Closed
ITrium-Salah opened this issue Sep 16, 2024 · 5 comments · Fixed by #43348
Closed
Labels
area/hibernate-reactive Hibernate Reactive kind/bug Something isn't working triage/upstream Used for issues which are caused by issues in upstream projects/dependency
Milestone

Comments

@ITrium-Salah
Copy link

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

java.lang.ClassCastException: class org.hibernate.sql.results.graph.embeddable.internal.EmbeddableInitializerImpl cannot be cast to class org.hibernate.reactive.sql.results.graph.ReactiveInitializer (org.hibernate.sql.results.graph.embeddable.internal.EmbeddableInitializerImpl and org.hibernate.reactive.sql.results.graph.ReactiveInitializer are in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @10feca44)
    at org.hibernate.reactive.sql.results.graph.entity.internal.ReactiveEntityInitializerImpl.initializeId(ReactiveEntityInitializerImpl.java:748)
    at org.hibernate.reactive.sql.results.graph.entity.internal.ReactiveEntityInitializerImpl.reactiveResolveKey(ReactiveEntityInitializerImpl.java:625)
    at org.hibernate.reactive.sql.results.graph.entity.internal.ReactiveEntityInitializerImpl.reactiveResolveKey(ReactiveEntityInitializerImpl.java:605)
    at org.hibernate.reactive.sql.results.graph.entity.internal.ReactiveEntityInitializerImpl.reactiveResolveKey(ReactiveEntityInitializerImpl.java:56)
    at org.hibernate.reactive.sql.results.internal.ReactiveStandardRowReader.resolveKey(ReactiveStandardRowReader.java:383)
    at org.hibernate.reactive.sql.results.internal.ReactiveStandardRowReader.lambda$coordinateInitializers$28(ReactiveStandardRowReader.java:376)

How to Reproduce?

My code is simple.

class A extends PanacheEntityBase{
    @EmbeddedId 
    B id;
 
}
@Embeddable
class B implements Serializable{
    @Column(nullable=false)
    String c1;
    @Column(nullable=false)
    String c2;
}

Http Route
return A.listAll();

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

3.14.4

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

mvn 3.9.5

Additional information

Work around: Use @IdClass

@ITrium-Salah ITrium-Salah added the kind/bug Something isn't working label Sep 16, 2024
Copy link

quarkus-bot bot commented Sep 16, 2024

/cc @DavideD (hibernate-reactive), @gavinking (hibernate-reactive)

@quarkus-bot quarkus-bot bot added the area/hibernate-reactive Hibernate Reactive label Sep 16, 2024
@DavideD
Copy link
Contributor

DavideD commented Sep 16, 2024 via email

@geoand geoand added the triage/upstream Used for issues which are caused by issues in upstream projects/dependency label Sep 17, 2024
@DavideD
Copy link
Contributor

DavideD commented Sep 19, 2024

This should be fixed by #43348

@tmonney
Copy link

tmonney commented Nov 1, 2024

Any chance to have this backported to 3.15?

@yrodiere
Copy link
Member

yrodiere commented Nov 4, 2024

Yes it will be, as indicated on the PR:

Image

@gsmet gsmet modified the milestones: 3.16.0.CR1, 3.15.2 Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-reactive Hibernate Reactive kind/bug Something isn't working triage/upstream Used for issues which are caused by issues in upstream projects/dependency
Projects
None yet
6 participants