redhat-developer-demos / quarkus-petclinic

Apache License 2.0
18 stars 50 forks source link

[BUG] Running quarkus:dev fails with date format error #7

Closed ksilz closed 1 year ago

ksilz commented 1 year ago

The latest commit on master gives me this error when running mvn clean compile quarkus:dev:

$ mvn clean compile quarkus:dev
[INFO] Scanning for projects...
[INFO]
[INFO] ----------< org.quarkus.samples.petclinic:quarkus-petclinic >-----------
[INFO] Building quarkus-petclinic 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]

[...]

2023-01-24 13:28:48,494 INFO  [io.qua.dat.dep.dev.DevServicesDatasourceProcessor] (build-40) Dev Services for the default datasource (postgresql) started - container ID is 98678c40453e
2023-01-24 13:28:52,317 INFO  [io.qua.kub.cli.dep.DevServicesKubernetesProcessor] (build-52) Dev Services for Kubernetes started. Other Quarkus applications in dev mode will find the cluster automatically.
2023-01-24 13:28:52,319 INFO  [io.qua.dep.dev.IsolatedDevModeMain] (main) Attempting to start live reload endpoint to recover from previous Quarkus startup failure
2023-01-24 13:28:52,497 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
    [error]: Build step io.quarkus.qute.deployment.QuteProcessor#processTemplateErrors threw an exception: io.quarkus.qute.TemplateException: Found incorrect expressions (4):
    [1] ownerDetails.html:45:17 - {pet.birthDate.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
    [2] ownerDetails.html:65:19 - {visit.date.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
    [3] createOrUpdateVisitForm.html:20:13 - {pet.birthDate.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
    [4] createOrUpdateVisitForm.html:77:13 - {v.date.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method

    at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:238)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:909)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:281)
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
    at java.base/java.lang.Thread.run(Thread.java:833)
    at org.jboss.threads.JBossThread.run(JBossThread.java:501)
    Suppressed: io.quarkus.qute.TemplateException: ownerDetails.html:45:17 - {pet.birthDate.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
        at io.quarkus.qute.TemplateException$Builder.build(TemplateException.java:169)
        at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:215)
        ... 11 more
    Suppressed: io.quarkus.qute.TemplateException: ownerDetails.html:65:19 - {visit.date.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
        at io.quarkus.qute.TemplateException$Builder.build(TemplateException.java:169)
        at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:215)
        ... 11 more
    Suppressed: io.quarkus.qute.TemplateException: createOrUpdateVisitForm.html:20:13 - {pet.birthDate.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
        at io.quarkus.qute.TemplateException$Builder.build(TemplateException.java:169)
        at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:215)
        ... 11 more
    Suppressed: io.quarkus.qute.TemplateException: createOrUpdateVisitForm.html:77:13 - {v.date.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
        at io.quarkus.qute.TemplateException$Builder.build(TemplateException.java:169)
        at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:215)
        ... 11 more

    at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:335)
    at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:252)
    at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:60)
    at io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:86)
    at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:447)
    at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:59)
    at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:149)
    at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:104)
    at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:131)
    at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:62)
Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
    [error]: Build step io.quarkus.qute.deployment.QuteProcessor#processTemplateErrors threw an exception: io.quarkus.qute.TemplateException: Found incorrect expressions (4):
    [1] ownerDetails.html:45:17 - {pet.birthDate.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
    [2] ownerDetails.html:65:19 - {visit.date.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
    [3] createOrUpdateVisitForm.html:20:13 - {pet.birthDate.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
    [4] createOrUpdateVisitForm.html:77:13 - {v.date.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method

    at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:238)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:909)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:281)
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
    at java.base/java.lang.Thread.run(Thread.java:833)
    at org.jboss.threads.JBossThread.run(JBossThread.java:501)
    Suppressed: io.quarkus.qute.TemplateException: ownerDetails.html:45:17 - {pet.birthDate.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
        at io.quarkus.qute.TemplateException$Builder.build(TemplateException.java:169)
        at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:215)
        ... 11 more
    Suppressed: io.quarkus.qute.TemplateException: ownerDetails.html:65:19 - {visit.date.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
        at io.quarkus.qute.TemplateException$Builder.build(TemplateException.java:169)
        at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:215)
        ... 11 more
    Suppressed: io.quarkus.qute.TemplateException: createOrUpdateVisitForm.html:20:13 - {pet.birthDate.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
        at io.quarkus.qute.TemplateException$Builder.build(TemplateException.java:169)
        at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:215)
        ... 11 more
    Suppressed: io.quarkus.qute.TemplateException: createOrUpdateVisitForm.html:77:13 - {v.date.format('yyyy-MM-ddoperty/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
        at io.quarkus.qute.TemplateException$Builder.build(TemplateException.java:169)
        at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:215)
        ... 11 more

    at io.quarkus.builder.Execution.run(Execution.java:123)
    at io.quarkus.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:79)
    at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:160)
    at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:331)
    ... 9 more
Caused by: io.quarkus.qute.TemplateException: Found incorrect expressions (4):
    [1] ownerDetails.html:45:17 - {pet.birthDate.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
    [2] ownerDetails.html:65:19 - {visit.date.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
    [3] createOrUpdateVisitForm.html:20:13 - {pet.birthDate.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
    [4] createOrUpdateVisitForm.html:77:13 - {v.date.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method

    at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:238)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:909)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:281)
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
    at java.base/java.lang.Thread.run(Thread.java:833)
    at org.jboss.threads.JBossThread.run(JBossThread.java:501)
    Suppressed: io.quarkus.qute.TemplateException: ownerDetails.html:45:17 - {pet.birthDate.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
        at io.quarkus.qute.TemplateException$Builder.build(TemplateException.java:169)
        at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:215)
        ... 11 more
    Suppressed: io.quarkus.qute.TemplateException: ownerDetails.html:65:19 - {visit.date.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
        at io.quarkus.qute.TemplateException$Builder.build(TemplateException.java:169)
        at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:215)
        ... 11 more
    Suppressed: io.quarkus.qute.TemplateException: createOrUpdateVisitForm.html:20:13 - {pet.birthDate.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
        at io.quarkus.qute.TemplateException$Builder.build(TemplateException.java:169)
        at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:215)
        ... 11 more
    Suppressed: io.quarkus.qute.TemplateException: createOrUpdateVisitForm.html:77:13 - {v.date.format('yyyy-MM-dd')}: Property/method [format('yyyy-MM-dd')] not found on class [java.time.LocalDate] nor handled by an extension method
        at io.quarkus.qute.TemplateException$Builder.build(TemplateException.java:169)
        at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:215)
        ... 11 more

--
Tests paused
Press [r] to resume testing, [o] Toggle test output, [:] for the terminal, [h] for more options>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  14.640 s
[INFO] Finished at: 2023-01-24T13:28:56Z
[INFO] ------------------------------------------------------------------------
%
ksilz commented 1 year ago

I'm running macOS Ventura 13.2 on an M1 Max 2021 MacBook Pro 16 with the Temurin OpenJDK 17.0.5 and Docker Desktop 4.16.2.

geoand commented 1 year ago

Thanks for reporting.

I'll have a look

geoand commented 1 year ago

https://github.com/redhat-developer-demos/quarkus-petclinic/pull/8 should take care of it

geoand commented 1 year ago

After talking with @mkouba, my fix should not be needed because Qute already provides such an extension method. However we are trying to see why you are getting the error.

ksilz commented 1 year ago

@geoand Please wait while I install the tooling so I can download the PR to my local repo.

geoand commented 1 year ago

👍🏼

This might an M1 issue, we are waiting to confirm

mkouba commented 1 year ago

Yes, the fix is not correct and should not be merged until we know what the real problem is.

geoand commented 1 year ago

Right, I have converted the PR to draft

geoand commented 1 year ago

But @mkouba we will likely need the fix until we have a Quarkus version that fixes the issue

geoand commented 1 year ago

@gastaldi ran this on his M1 and experience the same issue. So it is M1 specific and we'll have to fix it. But in the meantime @mkouba I propose we merge #8

ksilz commented 1 year ago

@geoand Yep, works for me with #8. Thank you!#8

One question: This is how the application looks like this on my Mac (Safari & Firefox). Could it be that the nav bar button doesn't show properly? image

geoand commented 1 year ago

@ksilz thanks for checking!

As for the UI, I am totally the wrong person to be able to answer that :) My UI skills is totally non-existent :(, but I can say that it did work properly for me on Chrome on a Linux box.

mkouba commented 1 year ago

But in the meantime @mkouba I propose we merge #8

Feel free to merge #8 but (1) pls add some comment to the Temporals class and (2) file a new issue to revert this commit once we find/fix the real cause.

geoand commented 1 year ago

I added some comments to the code.