question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DEV UI NPE when channel not configured.

See original GitHub issue

Describe the bug DEV UI throws NPE when you have @Incoming annotated method without input. Expected behavior DEV UI messaging part should not expect that everything is always connected. Throughout development it can happen to have channels which are not connected to any input.

Actual behavior Internal server error because of NPE. publisher is null in DevChannelInfo class.

To Reproduce

/**
 * Process event.
 */
@Incoming("bogus-channel")
public void process(Event event) {
	System.out.println(event);
}

Steps to reproduce the behavior:

  1. Create incoming channel which is not configured with connector or in-memory emitter.
  2. Start the application in DEV mode.
  3. Open DEV UI

Environment (please complete the following information): Environment information is not need here.

  • Output of uname -a or ver: Darwin Kernel Version 20.3.0
  • Output of java -version: Java version: 1.8.0_281, vendor: Oracle Corporation
  • GraalVM version (if different from Java): Not applicable.
  • Quarkus version or git rev: 1.12.0.Final
  • Build tool (ie. output of mvnw --version or gradlew --version): Apache Maven 3.6.3

Additional context Stack trace:

[io.qua.ver.htt.dep.dev.con.DevConsoleProcessor] (vert.x-eventloop-thread-1) Dev console request failed : java.lang.IllegalStateException: Reflection invocation error
	at io.quarkus.qute.ReflectionValueResolver.resolve(ReflectionValueResolver.java:58)
	at io.quarkus.qute.EvaluatorImpl.resolve(EvaluatorImpl.java:128)
	at io.quarkus.qute.EvaluatorImpl.resolveReference(EvaluatorImpl.java:79)
	at io.quarkus.qute.EvaluatorImpl.lambda$evaluate$0(EvaluatorImpl.java:41)
	at java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:995)
	at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2137)
	at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:110)
	at io.quarkus.qute.EvaluatorImpl.evaluate(EvaluatorImpl.java:39)
	at io.quarkus.qute.ResolutionContextImpl.evaluate(ResolutionContextImpl.java:31)
	at io.quarkus.qute.ExpressionNode.resolve(ExpressionNode.java:26)
	at io.quarkus.qute.SectionNode$SectionResolutionContextImpl.execute(SectionNode.java:134)
	at io.quarkus.qute.SectionHelper$SectionResolutionContext.execute(SectionHelper.java:37)
	at io.quarkus.qute.Parser$1.resolve(Parser.java:1017)
	at io.quarkus.qute.SectionNode.resolve(SectionNode.java:34)
	at io.quarkus.qute.TemplateImpl$TemplateInstanceImpl.renderData(TemplateImpl.java:107)
	at io.quarkus.qute.TemplateImpl$TemplateInstanceImpl.renderAsync(TemplateImpl.java:90)
	at io.quarkus.qute.TemplateImpl$TemplateInstanceImpl.render(TemplateImpl.java:55)
	at io.quarkus.qute.Template.render(Template.java:109)
	at io.quarkus.vertx.http.deployment.devmode.console.DevConsole.sendMainPage(DevConsole.java:143)
	at io.quarkus.vertx.http.deployment.devmode.console.DevConsole.handle(DevConsole.java:76)
	at io.quarkus.vertx.http.deployment.devmode.console.DevConsole.handle(DevConsole.java:32)
	at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1038)
	at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:137)
	at io.vertx.ext.web.impl.RoutingContextWrapper.next(RoutingContextWrapper.java:176)
	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:1038)
	at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:137)
	at io.vertx.ext.web.impl.RoutingContextWrapper.next(RoutingContextWrapper.java:176)
	at io.vertx.ext.web.impl.RouterImpl.handleContext(RouterImpl.java:235)
	at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1038)
	at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:137)
	at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:132)
	at io.vertx.ext.web.impl.RouterImpl.handle(RouterImpl.java:54)
	at io.vertx.ext.web.impl.RouterImpl.handle(RouterImpl.java:36)
	at io.quarkus.vertx.http.deployment.devmode.console.DevConsoleProcessor$2$1.handle(DevConsoleProcessor.java:167)
	at io.quarkus.vertx.http.deployment.devmode.console.DevConsoleProcessor$2$1.handle(DevConsoleProcessor.java:164)
	at io.vertx.core.http.impl.Http1xServerConnection.handleMessage(Http1xServerConnection.java:136)
	at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:366)
	at io.vertx.core.impl.EventLoopContext.execute(EventLoopContext.java:43)
	at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:229)
	at io.vertx.core.net.impl.VertxHandler.channelRead(VertxHandler.java:163)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
	at io.quarkus.netty.runtime.virtual.VirtualChannel.readInbound(VirtualChannel.java:251)
	at io.quarkus.netty.runtime.virtual.VirtualChannel.doBeginRead(VirtualChannel.java:274)
	at io.netty.channel.AbstractChannel$AbstractUnsafe.beginRead(AbstractChannel.java:843)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.read(DefaultChannelPipeline.java:1362)
	at io.netty.channel.AbstractChannelHandlerContext.invokeRead(AbstractChannelHandlerContext.java:686)
	at io.netty.channel.AbstractChannelHandlerContext.read(AbstractChannelHandlerContext.java:671)
	at io.netty.channel.DefaultChannelPipeline.read(DefaultChannelPipeline.java:1004)
	at io.netty.channel.AbstractChannel.read(AbstractChannel.java:278)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.readIfIsAutoRead(DefaultChannelPipeline.java:1422)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelActive(DefaultChannelPipeline.java:1400)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:230)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:216)
	at io.netty.channel.DefaultChannelPipeline.fireChannelActive(DefaultChannelPipeline.java:895)
	at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:510)
	at io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:417)
	at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:474)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at io.quarkus.qute.MethodWrapper.getValue(MethodWrapper.java:22)
	at io.quarkus.qute.ReflectionValueResolver.resolve(ReflectionValueResolver.java:56)
	... 71 more
Caused by: java.lang.NullPointerException
	at io.quarkus.smallrye.reactivemessaging.runtime.devconsole.DevReactiveMessagingInfos$DevChannelInfo.compareTo(DevReactiveMessagingInfos.java:142)
	at io.quarkus.smallrye.reactivemessaging.runtime.devconsole.DevReactiveMessagingInfos$DevChannelInfo.compareTo(DevReactiveMessagingInfos.java:115)
	at java.util.ComparableTimSort.countRunAndMakeAscending(ComparableTimSort.java:325)
	at java.util.ComparableTimSort.sort(ComparableTimSort.java:188)
	at java.util.Arrays.sort(Arrays.java:1312)
	at java.util.Arrays.sort(Arrays.java:1506)
	at java.util.ArrayList.sort(ArrayList.java:1464)
	at java.util.Collections.sort(Collections.java:143)
	at io.quarkus.smallrye.reactivemessaging.runtime.devconsole.DevReactiveMessagingInfos$1.get(DevReactiveMessagingInfos.java:97)
	at io.quarkus.smallrye.reactivemessaging.runtime.devconsole.DevReactiveMessagingInfos$1.get(DevReactiveMessagingInfos.java:28)
	at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
	at io.quarkus.smallrye.reactivemessaging.runtime.devconsole.DevReactiveMessagingInfos.getChannels(DevReactiveMessagingInfos.java:112)
	... 77 more

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
gsmetcommented, Feb 24, 2021

Even if it was the case, I would try to be safe in the UI. Because if things change at some point, we won’t notice it.

0reactions
mkoubacommented, Feb 24, 2021

@mkouba it should fail, yes, but only on recent Smallrye Reactive Messaging.

I see. Anyway, the NPE should be fixed in the linked PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.NullPointerException (no error message)
I've deleted .gradle folder from the project and was able to rebuild it again. N.B: Make a backup, just in case.
Read more >
Java NullPointerException - Detect, Fix, and Best Practices
1. NullPointerException when calling an instance method. When we run the above program, it throws the following NullPointerException error ...
Read more >
"java.lang.NullPointerException" while importing the IDD ...
​To resolve this issue, check the dependent lookup configuration in the BDDConfig.xml file and ensure that the lookups are configured correctly.
Read more >
Configuration | Android Developers
Constant for colorMode : a COLOR_MODE_WIDE_COLOR_GAMUT_MASK value indicating that it is unknown whether or not the screen is wide gamut.
Read more >
Cisco Firepower Release Notes, Version 6.6 - Security
After upgrade FMC from 6409-59 to 6.6.0-90 unable to log UI using Radius ... FTD - Port-channel not coming up after upgrade and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found