I'm having trouble getting templates to resolve in Quarkus version 1.2.0.FINAL
. I'm following the guides, and as far as I can tell I have everything set up correctly. I really would like to have more to put for this but there doesn't seem to be much to try here (it seems like it should be super straight forward). I'm using Gradle to run my builds, if that matters.
Qute dependencies:
implementation 'io.quarkus:quarkus-qute'
implementation 'io.quarkus:quarkus-resteasy-qute'
Code:
@ApplicationScoped
public class LifecycleBean {
private static final Logger LOGGER = LoggerFactory.getLogger(LifecycleBean.class);
private ZonedDateTime startDateTime;
private ZonedDateTime endDateTime;
// @Inject
@ResourcePath("startTemplate")
Template startTemplate;
...
}
I have a template file located at: src/main/resources/templates/startTemplate.txt
Error:
Caused by: java.lang.IllegalStateException: No template found for com.gjs.taskTimekeeper.webServer.server.LifecycleBean#startTemplate
I have this issue outlined in this SO question as well: https://stackoverflow.com/questions/60131253/quarkus-qute-cant-resolve-template
Travis: https://travis-ci.com/github/GregJohnStewart/task-timekeeper/branches
Git: https://github.com/GregJohnStewart/task-timekeeper/tree/webserver-work-template/WebServer/Server
Hello @GregJohnStewart, can you for now try changing this:
@ResourcePath("startTemplate")
to
@ResourcePath("startTemplate.txt")
and see if it works.
Additionally, can you enable DEBUG
logging level for io.quarkus.qute.deployment
and post the output of those logs when you build and run your application? More on logging configuration can be found here https://quarkus.io/guides/logging
I had initially been trying without the file extension, and added it as a debug.
Here's the log:
/cc @mkouba
I've a feeling that this might be related to gradle usage. Any chance you can either try this with Maven or share the gradle project as a github repo for one of us to try and reproduce this?
I can share the repo sure, but it would be nontrivial to switch to Maven at this point....
https://github.com/GregJohnStewart/task-timekeeper
I am working on the webserver-work
branch
The command to run (to show the package structure to the server):
./gradlew :WebServer:Server:quarkusdev
... also I think something weird is happening, might be gradle related? It was actually able to wire the template correctly once in dev, but never in test. Now all I get though is a null template object but no error when running dev.
Might be interesting to test master with this given all the class loading changes there.
Master is far behind the webserver branch, If the server runs in master its a super barebones with some experiments with Mongo codecs, but no qute
@mkouba could you have a look at that one? We have a reproducer above and it could be a major issue with Gradle + Qute so let's at least try to understand what's going on.
Thanks!
I can try to but I'm no gradle expert...
So I can see a different error that should be fixed in master/1.3.0.Alpha2 and is caused by the fact that Qute engine could be initialized after @Observes StartupEvent
notification.
@GregJohnStewart is there a chance that you could test it with quarkus 1.3.0.Alpha2?
It should be noted that I accidentally committed a change where I commented out the template so I could continue work elsewhere, so if the tests still run, check if the template code is commented out in LifecycleBean.java:22-24
.
@mkouba I would like to, but I get the following error when I try to run 1.3.*
:
Execution failed for task ':WebServer:Server:quarkusTestConfig'.
> Failed to resolve deployment classpath
Are there any more required gradle setup changes since 1.2.0.Final
?
It should be noted that I accidentally committed a change where I commented out the template
Yep, I've uncommented the injection point and the logic inside the observer method before I've tried to run the app ;-)
Are there any more required gradle setup changes since 1.2.0.Final?
I have no idea. We need some gradle experts here... @gastaldi @geoand Any ideas?
I have no idea. We need some gradle experts here... @gastaldi @geoand Any ideas?
I haven't followed the latest gradle stuff, so @gastaldi is the person to turn to for the expert advice
Probably worth to have a look at that one soon as it might hide a regression in 1.3 if the OP can't upgrade.
I upgraded your application to the latest master, uncommented the code in your LifecycleBean
and it works fine. It crashes with a ZipException in 1.3.0.Alpha2 though (probably related to https://github.com/quarkusio/quarkus/pull/7237) :
2020-02-21 15:05:03,780 INFO [main] (com.gjs.taskTimekeeper.webServer.server.LifecycleBean.onStart(LifecycleBean.java:52) ) - start template: io.quarkus.qute.runtime.TemplateProducer$InjectableTemplate@65f3e805
-8-=-=-=-=-8-
| ,dOOOb, | Task Timekeeper Web Server
|d b| Version: 1.0.0.278
|\::. .::/| Build day/time: 2020-02-21T15:04:54.436-03:00[America/Sao_Paulo]
| \:::::/ |
| \:::/ | Library versions used:
| x:x | Core: 1.1.0.338
| / . \ | ManagerIO: 1.0.0.409
| / . \ | Stats: 1.3.0.201
|/ .:. \| Web: 1.0.0.279
|Y.:::::.Y|
| "YOOOY" |
-8-=-=-=-=-8-
Here my diff:
diff --git a/WebServer/Server/gradle.properties b/WebServer/Server/gradle.properties
index b386854..ace17b8 100644
--- a/WebServer/Server/gradle.properties
+++ b/WebServer/Server/gradle.properties
@@ -1,5 +1,5 @@
-quarkusPlatformVersion=1.2.0.Final
+quarkusPlatformVersion=999-SNAPSHOT
#quarkusPlatformVersion=1.3.0.Alpha1
#quarkusPlatformArtifactId=quarkus-bom
-quarkusPlatformArtifactId=quarkus-universe-bom
+quarkusPlatformArtifactId=quarkus-bom
quarkusPlatformGroupId=io.quarkus
diff --git a/WebServer/Server/src/main/java/com/gjs/taskTimekeeper/webServer/server/LifecycleBean.java b/WebServer/Server/src/main/java/com/gjs/taskTimekeeper/webServer/server/LifecycleBean.java
index 868b87c..17236f6 100644
--- a/WebServer/Server/src/main/java/com/gjs/taskTimekeeper/webServer/server/LifecycleBean.java
+++ b/WebServer/Server/src/main/java/com/gjs/taskTimekeeper/webServer/server/LifecycleBean.java
@@ -1,6 +1,7 @@
package com.gjs.taskTimekeeper.webServer.server;
import com.gjs.taskTimekeeper.baseCode.core.timeParser.TimeParser;
+import io.quarkus.qute.Template;
import io.quarkus.runtime.ShutdownEvent;
import io.quarkus.runtime.StartupEvent;
import org.eclipse.microprofile.config.inject.ConfigProperty;
@@ -9,6 +10,8 @@ import org.slf4j.LoggerFactory;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
+import javax.inject.Inject;
+
import java.time.Duration;
import java.time.ZonedDateTime;
@@ -19,9 +22,8 @@ public class LifecycleBean {
private ZonedDateTime startDateTime;
//TODO:: come back to this when working.
-// @Inject
-// @ResourcePath("startTemplate")
-// Template startTemplate;
+ @Inject
+ Template startTemplate;
@ConfigProperty(name = "version")
String serverVersion;
@@ -46,17 +48,17 @@ public class LifecycleBean {
LOGGER.debug("Stats lib version: {}", this.statsVersion);
LOGGER.debug("Web lib version: {}", this.webLibVersion);
-// LOGGER.info("start template: {}", this.startTemplate);
-// System.out.println(
-// this.startTemplate
-// .data("serverVersion", this.serverVersion)
-// .data("buildTime", this.buildtime)
-// .data("coreVersion", this.coreVersion)
-// .data("ioVersion", this.managerIOVersion)
-// .data("statsVersion", this.statsVersion)
-// .data("webVersion", this.webLibVersion)
-// .render()
-// );
+ LOGGER.info("start template: {}", this.startTemplate);
+ System.out.println(
+ this.startTemplate
+ .data("serverVersion", this.serverVersion)
+ .data("buildTime", this.buildtime)
+ .data("coreVersion", this.coreVersion)
+ .data("ioVersion", this.managerIOVersion)
+ .data("statsVersion", this.statsVersion)
+ .data("webVersion", this.webLibVersion)
+ .render()
+ );
}
void onStop(@Observes ShutdownEvent ev) {
diff --git a/gradle.properties b/gradle.properties
index a08ddd1..b113dc3 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,2 +1,2 @@
-quarkusPluginVersion=1.2.0.Final
+quarkusPluginVersion=999-SNAPSHOT
#quarkusPluginVersion=1.3.0.Alpha1
That's all odd. I can't reproduce, I still can't switch to 1.3 (mostly hitting maven resolution issues with 999-SNAPSHOT
...)
How many times did you try running it? I had it run once as well, but only once.
You need to build quarkus from sources first. Clone the repo and do a mvn
clean install -DskipTests - T 1C
Em Sex, 21 de fev de 2020 15:58, Greg Stewart notifications@github.com
escreveu:
That's all odd. I can't reproduce, I still can't switch to 1.3 (mostly
hitting maven resolution issues with 999-SNAPSHOT...)How many times did you try running it? I had it run once as well, but only
once.โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/quarkusio/quarkus/issues/7156?email_source=notifications&email_token=AAANG5O75WDPL7DEGBI6JR3REAP45A5CNFSM4KTPDT22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMTXJSQ#issuecomment-589788362,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAANG5LV2HF4KEYWLESOCG3REAP45ANCNFSM4KTPDT2Q
.
I figured that was the case. I'll give that a go
@GregJohnStewart another option is to add this snapshot repo to your build: https://oss.sonatype.org/content/repositories/snapshots/ .
We publish snapshots there: https://oss.sonatype.org/content/repositories/snapshots/io/quarkus/ .
After installing latest from Master locally, I can resolve dependencies but get the following error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':WebServer:Server:quarkusTestConfig'.
> Failed to resolve deployment classpath
... any ideas? Unsure why it would be happening to me and not you. Also, I'm using the jdk and not graal because I haven't yet tried doing anything related to native builds
I am using OpenJDK 8. What do you get with --stacktrace
?
Em Sex, 21 de fev de 2020 16:50, Greg Stewart notifications@github.com
escreveu:
After installing latest from Master locally, I can resolve dependencies
but get the following error:FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':WebServer:Server:quarkusTestConfig'.Failed to resolve deployment classpath
... any ideas? Unsure why it would be happening to me and not you. Also,
I'm using the jdk and not graal because I haven't yet tried doing anything
related to native buildsโ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/quarkusio/quarkus/issues/7156?email_source=notifications&email_token=AAANG5PMHPU7DCBKYNG3UILREAWAVA5CNFSM4KTPDT22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMT4IDA#issuecomment-589808652,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAANG5I26M4X4X3Y6745ALLREAWAVANCNFSM4KTPDT2Q
.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':WebServer:Server:quarkusTestConfig'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:187)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:185)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:166)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:374)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:361)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:354)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:340)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: java.lang.IllegalStateException: Failed to resolve deployment classpath
at io.quarkus.gradle.tasks.QuarkusTestConfig.setupTest(QuarkusTestConfig.java:38)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:49)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:721)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:688)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.run(ExecuteActionsTaskExecuter.java:539)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:524)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:507)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:109)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:258)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:247)
at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:33)
at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:33)
at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:63)
at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35)
at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:49)
at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:34)
at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:43)
at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:34)
at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:44)
at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:54)
at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:38)
at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:153)
at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:67)
at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:41)
at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:44)
at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:33)
at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:92)
at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:85)
at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39)
at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76)
at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:94)
at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49)
at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:79)
at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:53)
at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:78)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:78)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:39)
at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:40)
at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:28)
at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:174)
... 30 more
Caused by: java.lang.NullPointerException
at io.quarkus.bootstrap.model.AppArtifact.writeObject(AppArtifact.java:40)
at io.quarkus.gradle.tasks.QuarkusGradleUtils.serializeAppModel(QuarkusGradleUtils.java:15)
at io.quarkus.gradle.tasks.QuarkusTestConfig.setupTest(QuarkusTestConfig.java:30)
... 92 more
Here is my full output, let me know if that's exactly what you're doing: https://asciinema.org/a/QMcLdB3kV9S4FR98hcZOppW8B
Interesting, with the local snapshot I can run the server fine in dev mode, but only the test comes back with the > Failed to resolve deployment classpath
issue...
And with 1.2.1.Final, I can run properly in dev move, but test still can't resolve the template...
@GregJohnStewart can you share the final project using current master and the exact steps to reproduce your issue? Thanks!
Sure thing.
I am running quarkusDev
and test
, and am seeing the following results:
| Version | test
| dev
|
| --- | --- | --- |
| 1.2.1.Final | IllegalStateException: No template found
server init error | Tries to run, but the template object is null |
I can't seem to get latest to work for me, I get an enforcer error when I try to build quarkus locally (quarkus-build-parent: Some Enforcer rules have failed.
), and using 1.3.0.CR1
breaks my gradle build (some null pointer exception). As I pointed out before 8 days ago dev
ran fine, but the test
wouldn't run, failing to properly even get to starting.
Hello @GregJohnStewart,
and using 1.3.0.CR1 breaks my gradle build (some null pointer exception).
Can you please create a new issue for this one and add all relevant details including the exception stacktrace? We need issues like these to be reported along with details to help us stabilize the product.
Good point, I will do that. CR2 seems to have issues finding jars from other gradle sub projects
Allright, with the release of 1.3.0.Final
, still getting the same exception on test
that the template can't be found, but runs fine on quarkusDev
.
Exception:
java.lang.RuntimeException: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.arc.deployment.ArcProcessor#generateResources threw an exception: javax.enterprise.inject.spi.DeploymentException: java.lang.IllegalStateException: No template found for com.gjs.taskTimekeeper.webServer.server.LifecycleBean#startTemplate
at io.quarkus.arc.processor.BeanDeployment.processErrors(BeanDeployment.java:910)
at io.quarkus.arc.processor.BeanProcessor.processValidationErrors(BeanProcessor.java:138)
....
Caused by: java.lang.IllegalStateException: No template found for com.gjs.taskTimekeeper.webServer.server.LifecycleBean#startTemplate
at io.quarkus.qute.deployment.QuteProcessor.validateTemplateInjectionPoints(QuteProcessor.java:683)
... 12 more
I have the same issue but can get it working with:
gradle quarkusBuild test
Trying with the quarkusbuild, I didn't see any change :(
@GregJohnStewart what the exact gradle command I should use to reproduce the problem?
I've tried ./gradlew build
and the result is BUILD SUCCESSFUL in 45s
(I had to comment out TimeParserTest
which probably contains some locale-specific assertions and UserEntityTest
). ./gradlew :WebServer:Server:quarkusdev
seems to work fine as well. I've tested both java8 and java11.
It's test
that fails. Yes it seems that it now works in dev, but not test
Hm, I've run out of ideas: ./gradlew :WebServer:Server:test
=> BUILD SUCCESSFUL in 41s
.
You might need to uncomment the template code in LifecycleBean.java
@GregJohnStewart can you create a branch with what's failing for you? This way, we would have something to reproduce it.
Thanks!
I was just thinking the same thing... https://github.com/GregJohnStewart/task-timekeeper/tree/webserver-work-template
@GregJohnStewart I've just tried your branch and
./gradlew :WebServer:Server:test
-> BUILD SUCCESSFUL in 24s.
./gradlew :WebServer:Server:quarkusdev
->
```
-8-=-=-=-=-8-
| ,dOOOb, | Task Timekeeper Web Server
|d b| Version: 1.0.0.278
|\::. .::/| Build day/time: 2020-03-19T13:15:07.869+01:00[Europe/Prague]
| \:::::/ |
| \:::/ | Library versions used:
| x:x | Core: 1.1.0.338
| / . \ | ManagerIO: 1.0.0.409
| / . \ | Stats: 1.3.0.201
|/ .:. \| Web: 1.0.0.279
|Y.:::::.Y|
| "YOOOY" |
-8-=-=-=-=-8-
````
What OS/java version do you use?
Interesting....
$ java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~19.10-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)
@mkouba what OS/version are you on? On mine I am still am having issues, as well as on the projects' travis: [error]: Build step io.quarkus.arc.deployment.ArcProcessor#generateResources threw an exception: javax.enterprise.inject.spi.DeploymentException: java.lang.IllegalStateException: No template found for com.gjs.taskTimekeeper.webServer.server.LifecycleBean#startTemplate
https://travis-ci.com/github/GregJohnStewart/task-timekeeper/branches
@GregJohnStewart I'm on Ubuntu 18.04.4 LTS. I may be missing something although I'm not sure what exactly...
... so any path forward for this? I would think it's possibly and environmental issue if it wasn't also happening to Travis.. @mkouba I am interested to see why it worked on yours.
It would be great if someone else could test it too. @gastaldi do you have some spare cycles?
@mkouba I wish I had but unfortunately nope :(
@GregJohnStewart can you reproduce it in 1.3.1.Final? I believe @aloubyansky made some changes in that area
@gastaldi Yeah I updated to 1.3.1.Final around when it was released, same issues unfortunately. I updated the OP to include travis and git urls to hopefully make it easier to see
Faced with similar issue when using qute templates with Gradle:
gradle clean build
-> build failed with No template found for com.github.daggerok.qute.IndexPage#index
errorgradle quarkusDev
, ctrl+c, gradle build
-> build successmy findings:
# after `rm -rf build ; ./gradlew build -x test` commands:
tree build/classes
build/classes
โโโ java
โโโ main
โโโ com
โโโ github
โโโ daggerok
โโโ qute
โโโ Factories.class
โโโ IndexPage.class
โโโ beans
โโโ Bar.class
โโโ Client.class
โโโ Foo.class
# but after: `rm -rf build ; ./gradlew quarkusDev, ctrl+c, ./gradlew build -x test` commands:
tree build/classes
build/classes
โโโ java
โโโ main
โโโ META-INF
โย ย โโโ resources
โโโ application.properties
โโโ com
โย ย โโโ github
โย ย โโโ daggerok
โย ย โโโ qute
โย ย โโโ Factories.class
โย ย โโโ IndexPage.class
โย ย โโโ beans
โย ย โโโ Bar.class
โย ย โโโ Client.class
โย ย โโโ Foo.class
โโโ templates
โโโ index.html
as you can see something goes wrong with gradle build, so templates are not in classpath...
so only after ./gradlew quarkudDev
command run / stop, project could be built successfully.
JDK: 11
Gradle: 6.3
Quarkus versions:
Regards,
Max
@daggerok Yes I see the same behavior... looks like something isn't properly moving resources around in test?
Also tested in 1.3.2, no change
I'll fix it.
A bit of news: with #8284 the following commands will work
gradle clean :WebServer:Server:test
gradle clean :WebServer:Server:quarkusDev
gradle clean :WebServer:Server:quarkusBuild
But gradle clean :WebServer:Server:build
fails with an intriguing error
Caused by: java.lang.ClassFormatError: Duplicate method name "<init>" with signature "()V" in class file com/gjs/taskTimekeeper/webServer/server/endpoints/user/UserRegistration
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:335)
at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:294)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at com.gjs.taskTimekeeper.webServer.server.endpoints.user.UserRegistration_Bean.<init>(UserRegistration_Bean.zig:437)
at io.quarkus.arc.setup.Default_ComponentsProvider.addBeans2(Default_ComponentsProvider.zig:1509)
at io.quarkus.arc.setup.Default_ComponentsProvider.getComponents(Default_ComponentsProvider.zig:43)
at io.quarkus.arc.impl.ArcContainerImpl.<init>(ArcContainerImpl.java:106)
at io.quarkus.arc.Arc.initialize(Arc.java:20)
I guess the class gets transformed twice.
Ok, it's gonna be fixed once the PR I mentioned in the previous post has been merged.
Interesting, and thanks for the fix. Wondering why there was the issue in my project and not in others?