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 fails to resolve a method invoked from an injected bean #15679

Closed
gastaldi opened this issue Mar 12, 2021 · 2 comments · Fixed by #15717
Closed

Qute fails to resolve a method invoked from an injected bean #15679

gastaldi opened this issue Mar 12, 2021 · 2 comments · Fixed by #15717
Assignees
Labels
area/qute The template engine kind/bug Something isn't working
Milestone

Comments

@gastaldi
Copy link
Contributor

gastaldi commented Mar 12, 2021

Describe the bug

Qute does not resolve a method properly to be invoked from an injected bean

Expected behavior

The method in the injected bean is invoked

Actual behavior

The following error is thrown during the build

io.quarkus.qute.TemplateException: Incorrect expression found: {inject:prettyTime.format(stats.updated)}
	- property/method [format(stats.updated)] not found on class [org.ocpsoft.prettytime.PrettyTime] nor handled by an extension method
	- at StatusResource/issues.html:17
		at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:173)

To Reproduce

Steps to reproduce the behavior:

  1. Clone https://github.com/gastaldi/quarkus-status
  2. Change to branch pretty_time
  3. Run mvn clean compile quarkus:dev

Configuration

# Add your application.properties here, if applicable.

Screenshots

(If applicable, add screenshots to help explain your problem.)

Environment (please complete the following information):

  • Output of uname -a or ver: Fedora 33
  • Output of java -version: JDK 11
  • GraalVM version (if different from Java): Not needed to reproduce
  • Quarkus version or git rev: 1.12.2.Final
  • Build tool (ie. output of mvnw --version or gradlew --version): Maven 3.6.3
@gastaldi gastaldi added the kind/bug Something isn't working label Mar 12, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 12, 2021

/cc @mkouba

@quarkus-bot quarkus-bot bot added the area/qute The template engine label Mar 12, 2021
@mkouba mkouba self-assigned this Mar 12, 2021
@mkouba
Copy link
Contributor

mkouba commented Mar 12, 2021

I can confirm that it's a bug. The fix is simple but I discovered another related bug in validation :-(. So I'll prepare a PR to fix both problems.

@mkouba mkouba added this to the 1.13 - master milestone Mar 12, 2021
mkouba added a commit to mkouba/quarkus that referenced this issue Mar 15, 2021
- when a class declares multiple methods with the same name
- resolves quarkusio#15679
- also process last part hints for virtual methods
mkouba added a commit to mkouba/quarkus that referenced this issue Mar 15, 2021
- when a class declares multiple methods with the same name
- resolves quarkusio#15679
- also process last part hints for virtual methods
gsmet pushed a commit to mkouba/quarkus that referenced this issue Mar 15, 2021
- when a class declares multiple methods with the same name
- resolves quarkusio#15679
- also process last part hints for virtual methods
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.

2 participants