quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.63k stars 2.64k forks source link

Collision Kotlin allopen plugin and Live Coding #29875

Open jon890 opened 1 year ago

jon890 commented 1 year ago

Describe the bug

I use hibernate reactive with kotlin So I write down my entites to kotlin class (it is final class) and I apply kotlin allopen plugin and I start my quarkus application to quarkus dev command.

First build, It is working well but running hot reloading and I think that don't applied kotlin allopen plugin.

Expected behavior

Live Coding activate and applied kotlin allopen plugin.

Actual behavior

I think the Kotlin allopen plugin doesn't applied to Live Coding

How to Reproduce?

  1. Write your entity with kotlin
  2. edit your source code
  3. Boom

Output of uname -a or ver

Darwin kbt.local 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 arm64

Output of java -version

openjdk version "17.0.5" 2022-10-18 OpenJDK Runtime Environment Temurin-17.0.5+8 (build 17.0.5+8) OpenJDK 64-Bit Server VM Temurin-17.0.5+8 (build 17.0.5+8, mixed mode)

GraalVM version (if different from Java)

no

Quarkus version or git rev

2.15.0 FINAL

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

7.5.1

Additional information

No response

quarkus-bot[bot] commented 1 year ago

/cc @evanchooly(kotlin), @geoand(kotlin)

geoand commented 1 year ago

Are you really using Quarkus 2.1.5? If so, that version is very old and I would suggest trying 2.15.0.Final and reporting back.

jon890 commented 1 year ago

Are you really using Quarkus 2.1.5? If so, that version is very old and I would suggest trying 2.15.0.Final and reporting back.

I made a typo, I am using 2.15.0.Final!

geoand commented 1 year ago

@glefloch haven't we addressed this one?

Feavy commented 10 months ago

Tthe issue is still there with latest version at the time (Quarkus 3.5.1 with Kotlin 1.9.10)

Hot reload doesn't work with allOpen kotlin plugin.

HHH000305: Could not create proxy factory for:fr.feavy.test.model.Fruit:
org.hibernate.HibernateException: Getter methods of lazy classes cannot be final: fr.feavy.test.model.Fruit#getName

Caused by: org.hibernate.HibernateException: Failed to generate Enhanced Proxy:
default constructor is missing for entity 'fr.feavy.test.model.Fruit'. Please add a default constructor explicitly.
mschorsch commented 10 months ago

I've found a workaround: https://github.com/quarkusio/quarkus/issues/37109#issuecomment-1828352002