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

java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 #21713

Closed
gastaldi opened this issue Nov 25, 2021 · 1 comment · Fixed by #21714
Closed

java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 #21713

gastaldi opened this issue Nov 25, 2021 · 1 comment · Fixed by #21714
Labels
area/qute The template engine kind/bug Something isn't working
Milestone

Comments

@gastaldi
Copy link
Contributor

When navigating to http://localhost:8080/q/dev/io.quarkus.quarkus-qute/preview in an empty project with quarkus-qute I get:

java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
	at java.base/java.util.Objects.checkIndex(Objects.java:359)
	at java.base/java.util.ArrayList.get(ArrayList.java:427)
	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.qute.MethodsCandidate$1.lambda$getValue$0(MethodsCandidate.java:44)
	at io.quarkus.qute.CompletedStage.whenComplete(CompletedStage.java:264)
	at io.quarkus.qute.MethodsCandidate$1.getValue(MethodsCandidate.java:27)
	at io.quarkus.qute.ReflectionValueResolver.resolve(ReflectionValueResolver.java:60)
	at io.quarkus.qute.EvaluatorImpl.resolve(EvaluatorImpl.java:176)
	at io.quarkus.qute.EvaluatorImpl.lambda$resolve$4(EvaluatorImpl.java:179)
	at io.quarkus.qute.CompletedStage.thenCompose(CompletedStage.java:228)
	at io.quarkus.qute.EvaluatorImpl.resolve(EvaluatorImpl.java:176)
	at io.quarkus.qute.EvaluatorImpl.lambda$resolve$4(EvaluatorImpl.java:179)
	at io.quarkus.qute.CompletedStage.thenCompose(CompletedStage.java:228)
	at io.quarkus.qute.EvaluatorImpl.resolve(EvaluatorImpl.java:176)
	at io.quarkus.qute.EvaluatorImpl.resolveReference(EvaluatorImpl.java:116)
	at io.quarkus.qute.EvaluatorImpl.lambda$resolveReference$2(EvaluatorImpl.java:117)
	at io.quarkus.qute.CompletedStage.thenCompose(CompletedStage.java:228)
	at io.quarkus.qute.EvaluatorImpl.resolveReference(EvaluatorImpl.java:117)
	at io.quarkus.qute.EvaluatorImpl.lambda$evaluate$0(EvaluatorImpl.java:67)
	at io.quarkus.qute.CompletedStage.thenCompose(CompletedStage.java:228)
	at io.quarkus.qute.EvaluatorImpl.evaluate(EvaluatorImpl.java:65)
	at io.quarkus.qute.ResolutionContextImpl$ChildResolutionContext.evaluate(ResolutionContextImpl.java:86)
	at io.quarkus.qute.ExpressionNode.resolve(ExpressionNode.java:25)
	at io.quarkus.qute.SectionNode$SectionResolutionContextImpl.execute(SectionNode.java:153)
	at io.quarkus.qute.InsertSectionHelper.resolve(InsertSectionHelper.java:20)
	at io.quarkus.qute.SectionNode.resolve(SectionNode.java:34)
	at io.quarkus.qute.SectionNode$SectionResolutionContextImpl.execute(SectionNode.java:153)
	at io.quarkus.qute.SectionHelper$SectionResolutionContext.execute(SectionHelper.java:37)
	at io.quarkus.qute.Parser$1.resolve(Parser.java:1037)
	at io.quarkus.qute.SectionNode.resolve(SectionNode.java:34)
	at io.quarkus.qute.IncludeSectionHelper.resolve(IncludeSectionHelper.java:34)
	at io.quarkus.qute.SectionNode.resolve(SectionNode.java:34)
	at io.quarkus.qute.SectionNode$SectionResolutionContextImpl.execute(SectionNode.java:149)
	at io.quarkus.qute.SectionHelper$SectionResolutionContext.execute(SectionHelper.java:37)
	at io.quarkus.qute.Parser$1.resolve(Parser.java:1037)
	at io.quarkus.qute.SectionNode.resolve(SectionNode.java:34)
	at io.quarkus.qute.TemplateImpl$TemplateInstanceImpl.renderData(TemplateImpl.java:104)
	at io.quarkus.qute.TemplateImpl$TemplateInstanceImpl.renderAsync(TemplateImpl.java:90)
	at io.quarkus.vertx.http.deployment.devmode.console.DevConsole.renderTemplate(DevConsole.java:153)
	at io.quarkus.vertx.http.deployment.devmode.console.DevConsole.handle(DevConsole.java:117)
	at io.quarkus.vertx.http.deployment.devmode.console.DevConsole.handle(DevConsole.java:36)
	at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1128)
	at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:154)
	at io.vertx.ext.web.impl.RoutingContextWrapper.next(RoutingContextWrapper.java:201)
	at io.quarkus.vertx.http.deployment.devmode.console.FlashScopeHandler.handle(FlashScopeHandler.java:12)
	at io.quarkus.vertx.http.deployment.devmode.console.FlashScopeHandler.handle(FlashScopeHandler.java:7)
	at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1128)
	at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:154)
	at io.vertx.ext.web.impl.RoutingContextWrapper.next(RoutingContextWrapper.java:201)
	at io.vertx.ext.web.impl.RouterImpl.handleContext(RouterImpl.java:236)
	at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1128)
	at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:154)
	at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:141)
	at io.vertx.ext.web.impl.RouterImpl.handle(RouterImpl.java:55)
	at io.vertx.ext.web.impl.RouterImpl.handle(RouterImpl.java:37)
	at io.quarkus.vertx.http.deployment.devmode.console.DevConsoleProcessor$2$1.handle(DevConsoleProcessor.java:203)
	at io.quarkus.vertx.http.deployment.devmode.console.DevConsoleProcessor$2$1.handle(DevConsoleProcessor.java:200)
	at io.vertx.core.impl.EventLoopContext.emit(EventLoopContext.java:50)
	at io.vertx.core.impl.EventLoopContext.lambda$emit$1(EventLoopContext.java:57)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:833)
Resulted in: java.lang.reflect.InvocationTargetException
	... 67 more
Resulted in: java.util.concurrent.CompletionException: java.lang.reflect.InvocationTargetException
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:332)
	at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1177)
	at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2309)
	at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:144)
	... 59 more

Originally posted by @gastaldi in #21705 (comment)

@gastaldi gastaldi added kind/bug Something isn't working area/qute The template engine and removed triage/needs-triage labels Nov 25, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Nov 25, 2021

/cc @mkouba

gastaldi added a commit to gastaldi/quarkus that referenced this issue Nov 25, 2021
gastaldi added a commit to gastaldi/quarkus that referenced this issue Nov 25, 2021
gastaldi added a commit to gastaldi/quarkus that referenced this issue Nov 25, 2021
@quarkus-bot quarkus-bot bot added this to the 2.6 - main milestone Nov 26, 2021
Postremus pushed a commit to Postremus/quarkus that referenced this issue Nov 27, 2021
@gsmet gsmet modified the milestones: 2.6 - main, 2.5.1.Final Nov 29, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Nov 29, 2021
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