-
-
Notifications
You must be signed in to change notification settings - Fork 268
Closed
Description
When using Quarkus dev mode / hot reload with the querybean-generator we can get the compilation error below.
This is because with the dev mode / hot reload the annotation processor tries to write the EntityClassRegister which already exists.
The fix for this issue is to not log this at ERROR level (which effectively means the compilation failed) but instead log it at WARN or INFO/NOTE level.
Steps to reproduce
Using Quarkus dev mode / hot reload with the querybean-generator
mvn Quarkus:dev- Trigger the "resume testing"
r - Wait for tests to all run
- Make some reasonable change to an entity bean
Compilation Failed:
error: FilerException trying to write EntityClassRegister error:javax.annotation.processing.FilerException: Attempt to recreate a file for type org.acme.domain.EbeanEntityRegister stack:[jdk.compiler/com.sun.tools.javac.processing.JavacFiler.checkNameAndExistence(JavacFiler.java:741), jdk.compiler/com.sun.tools.javac.processing.JavacFiler.createSourceOrClassFile(JavacFiler.java:498), jdk.compiler/com.sun.tools.javac.processing.JavacFiler.createSourceFile(JavacFiler.java:435), io.ebean.querybean.generator.ProcessingContext.createWriter(ProcessingContext.java:399), io.ebean.querybean.generator.SimpleModuleInfoWriter.<init>(SimpleModuleInfoWriter.java:31), io.ebean.querybean.generator.Processor.writeModuleInfoBean(Processor.java:90), io.ebean.querybean.generator.Processor.process(Processor.java:53), jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:1021), ...
After this fix is applied, and this is now logged as WARN we get:
2025-01-16 15:49:13,221 INFO [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2025-01-16 15:49:13,221 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, rest, smallrye-context-propagation, vertx]
2025-01-16 15:49:49,038 WARN [io.qua.dep.dev.JavaCompilationProvider] (Test Compile Timer) Ebean APT generated 1 query beans, loaded 0 others - META-INF/ebean-generated-info.mf entity-packages: [org.acme.domain], line -1 in [unknown source]
2025-01-16 15:49:49,039 WARN [io.qua.dep.dev.JavaCompilationProvider] (Test Compile Timer) File for type 'org.acme.domain.EbeanEntityRegister' created in the last round will not be subject to annotation processing., line -1 in [unknown source]
2025-01-16 15:49:49,039 WARN [io.qua.dep.dev.JavaCompilationProvider] (Test Compile Timer) filterMany(java.lang.String,java.lang.Object...) in io.ebean.typequery.TQAssocMany has been deprecated and marked for removal, line 154 in /Users/robinbygrave/Documents/github/rob/code-with-quarkus/target/generated-sources/annotations/org/acme/domain/query/QMyEntity.java
2025-01-16 15:49:49,040 WARN [io.qua.dep.dev.JavaCompilationProvider] (Test Compile Timer) _filterMany(java.lang.String,java.lang.Object...) in io.ebean.typequery.TQAssocBean has been deprecated and marked for removal, line 154 in /Users/robinbygrave/Documents/github/rob/code-with-quarkus/target/generated-sources/annotations/org/acme/domain/query/QMyEntity.javaSo its still a bit noisy but with no ERROR logged Quarkus dev mode / hot reload will still continue and run tests etc.