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 with panache project throws ClassCastException in dev mode #17421

Closed
ScientistPun opened this issue May 22, 2021 · 8 comments
Labels
area/devmode area/hibernate-reactive Hibernate Reactive area/panache area/persistence OBSOLETE, DO NOT USE kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant

Comments

@ScientistPun
Copy link

Describe the bug

I use hibernate reactive with panache to do my database work. When use two seccessive invocation of project on the same projection class in dev mode, it throws ClassCastException.

Expected behavior

Don't throw

Actual behavior

It throws ClassCastException

To Reproduce

Steps to reproduce the behavior:

  1. Write an Entity (e.g. E)
  2. Write a projection class (e.g. P)
  3. Project the class for the entity in Panache transaction twice by flatMap
  4. Start quarkus dev
  5. Modify something to let quarkus dev relaod
  6. It throws ClassCastException saying that P cannot be cast to P. It indicates that the same class P are from two different instances of io.quarkus.bootstrap.classloading.QuarkusClassLoader

Configuration

# Add your application.properties here, if applicable.

Screenshots

image

Environment (please complete the following information):

Output of uname -a or ver

Output of java -version

GraalVM version (if different from Java)

Quarkus version or git rev

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

Additional context

(Add any other context about the problem here.)

@ScientistPun ScientistPun added the kind/bug Something isn't working label May 22, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented May 22, 2021

@geoand
Copy link
Contributor

geoand commented May 24, 2021

What version of Quarkus are you seeing this issue in (asking because various similar issues have already been fixed)?

Can you attach a sample project that demonstrates this error please (mentioning this because it's important we have an exact reproducer as this could be caused by various things)?

@qiuhw
Copy link

qiuhw commented May 25, 2021

Hi, the bug reporter is my workmate.

What version of Quarkus are you seeing this issue in (asking because various similar issues have already been fixed)?

We use 1.13.4.Final the latest stable version.

Can you attach a sample project that demonstrates this error please (mentioning this because it's important we have an exact reproducer as this could be caused by various things)?

The sample project is attached

bug-demo.gz

@qiuhw
Copy link

qiuhw commented May 28, 2021

The problem also exists in 1.13.5.Final, 1.13.6.Final and 2.0.0.CR2.

@Sanne
Copy link
Member

Sanne commented Jul 27, 2021

I think this might be fixed in Quarkus main now as consequence of fixing #18875

But I can't try it again currently :) @DavideD could you test it?

@DavideD
Copy link
Contributor

DavideD commented Jul 27, 2021

Yes, I will have a look

@DavideD
Copy link
Contributor

DavideD commented Jul 29, 2021

I can confirm the live reload works now with the latest quarkus snapshot.
No exception is thrown.

@Sanne
Copy link
Member

Sanne commented Jul 29, 2021

excellent, thanks @DavideD !

@Sanne Sanne closed this as completed Jul 29, 2021
@geoand geoand added the triage/out-of-date This issue/PR is no longer valid or relevant label Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devmode area/hibernate-reactive Hibernate Reactive area/panache area/persistence OBSOLETE, DO NOT USE kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant
Projects
None yet
Development

No branches or pull requests

5 participants