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

Qute TemplateGlobal throws error on live reload #46005

Closed
gbourant opened this issue Jan 31, 2025 · 6 comments · Fixed by #46014
Closed

Qute TemplateGlobal throws error on live reload #46005

gbourant opened this issue Jan 31, 2025 · 6 comments · Fixed by #46014
Assignees
Labels
area/qute The template engine kind/bug Something isn't working
Milestone

Comments

@gbourant
Copy link

gbourant commented Jan 31, 2025

Describe the bug

I upgraded my app to the latest Quarkus version and i got the following error (it used to work)

java.lang.IllegalArgumentException: Namespace [global] may not be handled by multiple resolvers of the same priority [-999]: io.quarkiverse.renarde.util.Globals_Globals@56d489bd and gr.admin.qute.MyGlobal_Globals@45bbbc71

In my project i defined a class with @TemplateGlobal which has a dependency to Renarde which has it's own @TemplateGlobal class.

It might be related to #45771

When you start the app with mvn quarkus:dev it works as expected, but if you change something and trigger the live reload it will throw the error.

Also, i tried a prod build and the error did not occur.

Reproducer

@gbourant gbourant added the kind/bug Something isn't working label Jan 31, 2025
Copy link

quarkus-bot bot commented Jan 31, 2025

/cc @mkouba (qute)

@quarkus-bot quarkus-bot bot added the area/qute The template engine label Jan 31, 2025
@mkouba
Copy link
Contributor

mkouba commented Jan 31, 2025

When you start the app with mvn quarkus:dev it works as expected, but if you change something and trigger the live reload it will throw the error.

I cannot reproduce the problem locally. Could you try to clean all your builds? Maybe even the local Maven repository?

@gbourant
Copy link
Author

I deleted the local Maven repository and i was able to reproduce it. I don't know if it's related but this is the JDK that i'm using:

openjdk version "21.0.6" 2025-01-21
OpenJDK Runtime Environment (build 21.0.6+7)
OpenJDK 64-Bit Server VM (build 21.0.6+7, mixed mode, sharing)

@gbourant
Copy link
Author

gbourant commented Jan 31, 2025

Steps to reproduce:

  1. mvn clean quarkus:dev
  2. Open a browser to http://localhost:8080/hello
  3. Change the return value of HelloResource#hello method to something else.
  4. Press F5 to the browser window.
  5. The error occurs .

@mkouba
Copy link
Contributor

mkouba commented Jan 31, 2025

You're right and the fix introduced in #45771 was not correct. We need to find a way to assign a unique priority for application globals.

@mkouba mkouba self-assigned this Jan 31, 2025
@mkouba
Copy link
Contributor

mkouba commented Jan 31, 2025

By the way, it's kind of an ordering issue - that's why it sometimes might work and sometimes not. Bad idea of mine...

@mkouba mkouba closed this as completed in d85129e Feb 6, 2025
@quarkus-bot quarkus-bot bot added this to the 3.19 - main milestone Feb 6, 2025
@gsmet gsmet modified the milestones: 3.19 - main, 3.18.3 Feb 11, 2025
gsmet pushed a commit to gsmet/quarkus that referenced this issue Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/qute The template engine kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants