-
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
ClassNotFoundException when scheduler calls static @Transactional PanacheEntity method #32990
Comments
/cc @FroMage (panache), @loicmathieu (panache), @mkouba (scheduler) |
Hm, the generated |
I've tried to extract the intercepted static method in a separate class and still can see the same NCDFE. So it's likely not related to the bytecode transformation... |
And it fails with quarkus 3.0.1.Final too.. |
So the Base Runtime ClassLoader does not see the generated classes (which are hot deployable resources) by design. It only supports transformations, which are expected to be idempotent? I would argue that generated classes for external libraries should be idempotent as well but maybe I'm missing something 🤷. CC @stuartwdouglas @gsmet @geoand @aloubyansky ... |
There is a flag in the build item that allows you to make generated classes part of the application ClassLoader. Have you tried it? |
I don't think that |
That is exactly that this flag does, if it is false it is loaded by the base runtime CL, not the runtime CL. |
Ok, thanks. I think that I found the problem: https://github.com/quarkusio/quarkus/blob/main/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/staticmethods/InterceptedStaticMethodsProcessor.java#L157 and fix is on the way... Out of curiosity, where's the place where the |
quarkus/core/deployment/src/main/java/io/quarkus/runner/bootstrap/StartupActionImpl.java Line 353 in 6bd4185
|
👍 thanks! |
- fix the problem with dev mode and external libraries - also make sure the generated method does not start with a number - fixes quarkusio#32990
- fix the problem with dev mode and external libraries - also make sure the generated method does not start with a number - fixes quarkusio#32990
- fix the problem with dev mode and external libraries - also make sure the generated method does not start with a number - fixes quarkusio#32990
Thanks a lot! Keep up the great work. |
- fix the problem with dev mode and external libraries - also make sure the generated method does not start with a number - fixes quarkusio#32990
- fix the problem with dev mode and external libraries - also make sure the generated method does not start with a number - fixes quarkusio#32990 (cherry picked from commit fd48630)
- fix the problem with dev mode and external libraries - also make sure the generated method does not start with a number - fixes quarkusio#32990
Describe the bug
The following method cannot be called from a
@Scheduled
annotated method, if the entity class is imported from a lib and not part of the same source:Expected behavior
This call should work without throwing an exception:
Actual behavior
Class not found:
How to Reproduce?
mvn -f entity/pom.xml install
mvn -f app/pom.xml quarkus:dev
Output of
uname -a
orver
Microsoft Windows [Version 10.0.19045.2728]
Output of
java -version
openjdk version "17.0.6" 2023-01-17
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.16.6.Final & 3.0.1.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Maven 3.8.1
Additional information
Tested with:
JDBC extension:
quarkus-jdbc-h2
&quarkus-jdbc-mysql
Panache extension:
quarkus-hibernate-orm-panache
(reactive untested)Scheduler extension:
quarkus-scheduler
Possible workarounds:
Move the entity class or the
@Transactional
annotation into the main project.The text was updated successfully, but these errors were encountered: