-
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
Parent first dependencies method in Class Loading Reference guide not working for applications #29043
Milestone
Comments
One more thing. Quarkus code should be improved. A user shouldn't have to do any of this. Quarkus should not make it harder for tools like Byteman to be used with it. IOW Quarkus should hardcode byteman to be parent first class loaded. |
geoand
added a commit
to geoand/quarkus
that referenced
this issue
Nov 4, 2022
geoand
added a commit
to geoand/quarkus
that referenced
this issue
Nov 4, 2022
geoand
added a commit
that referenced
this issue
Nov 4, 2022
Update the classloading reference guide to mention fast-jar vs legacy-jar
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Nov 5, 2022
Relates to: quarkusio#29043 (cherry picked from commit 4929e1a)
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Nov 5, 2022
…-jar Closes: quarkusio#29043 (cherry picked from commit f1876ad)
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Nov 5, 2022
Relates to: quarkusio#29043 (cherry picked from commit 4929e1a)
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Nov 5, 2022
…-jar Closes: quarkusio#29043 (cherry picked from commit f1876ad)
Thx @geoand! |
🙏🏼 |
iocanel
pushed a commit
to iocanel/quarkus
that referenced
this issue
Nov 7, 2022
iocanel
pushed a commit
to iocanel/quarkus
that referenced
this issue
Nov 7, 2022
zakkak
pushed a commit
to zakkak/quarkus
that referenced
this issue
Nov 15, 2022
Relates to: quarkusio#29043 (cherry picked from commit 4929e1a)
zakkak
pushed a commit
to zakkak/quarkus
that referenced
this issue
Nov 15, 2022
…-jar Closes: quarkusio#29043 (cherry picked from commit f1876ad)
geoand
added a commit
to geoand/quarkus
that referenced
this issue
Nov 24, 2022
geoand
added a commit
to geoand/quarkus
that referenced
this issue
Dec 5, 2022
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Dec 6, 2022
Closes: quarkusio#29043 (cherry picked from commit 17eecf2)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
A Quarkus application that wants to use byteman to intercept and startup and shutdown events will suffer issues like this with default fast-jar.
On startup, byteman is loaded with the system classloader and it successfully injects the rule:
Then on shutdown, the rule won't trigger and you will see these messages appearing on byteman:
What is happening is that on shutdown, byteman classes are being loaded with a different classloader (the
RunnerClassLoader
). This is problematic because Byteman's rule has a static cache of rules, and when the class is loaded with another classloader different to the system one, the cache is empty and it won't trigger the rule. The above (tweaked) byteman log messages show that.The classloading guide indicates how to avoid this issue in the parent first dependencies section. The guide suggests to do add this to the pom.xml but for Quarkus applications (not extensions) it has no effect:
However, if you instead modify the app's
application.properties
file and add this:Then things will work:
What you're seeing above is the rule being loaded with the system classloader once again and things working as expected.
Documentation should make this clear.
Moreover, the following statement in the classloader guide is outdated:
There should be an explanation about fast-jar (vs legacy-jar)...etc.
Expected behavior
No response
Actual behavior
No response
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: