NPE when I try to create a instance of a custom component with a template f

Hello,

I’m using Vaadin 10.0.0.beta2 with Spring Boot 2.

I have the following problem:
When I try to create a new instance of my custom created component (with a HTML template file) I get this error:

java.lang.NullPointerException: null
	at com.vaadin.flow.component.polymertemplate.DefaultTemplateParser.getTemplateContent(DefaultTemplateParser.java:84)
	at com.vaadin.flow.component.polymertemplate.TemplateDataAnalyzer.parseTemplate(TemplateDataAnalyzer.java:179)
	at com.vaadin.flow.component.polymertemplate.TemplateInitializer.<init>(TemplateInitializer.java:87)
	at com.vaadin.flow.component.polymertemplate.PolymerTemplate.<init>(PolymerTemplate.java:68)
	at com.vaadin.flow.component.polymertemplate.PolymerTemplate.<init>(PolymerTemplate.java:83)
	at com.avides.waresca.verify.ui.view.instruction.ScannerRepresenter.<init>(ScannerRepresenter.java:39)
	at com.avides.waresca.verify.ui.view.instruction.DefaultInstructionView.lambda$null$929edefc$1(DefaultInstructionView.java:92)
	at com.vaadin.flow.component.UI.accessSynchronously(UI.java:383)
	at com.vaadin.flow.component.UI$1.execute(UI.java:447)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at com.vaadin.flow.server.VaadinService.runPendingAccessTasks(VaadinService.java:1945)
	... 56 common frames omitted

The component should be created after an action in the UI. I tried it with UI.getCurrent().access() but the same error occurs.

Can anyone help me out?

Greetings!

Hi,

You might want to update to the Beta 3 prerelease - looks like that particular piece of code where the exception was thrown from has been completely rewritten, so maybe your issue will be solved as well.

Regards,

Olli

Hey,

thanks for your reply. I have upgraded to 10.0.0.beta3 and get the same error:

java.lang.NullPointerException: null
	at com.vaadin.flow.component.polymertemplate.TemplateInitializer.<init>(TemplateInitializer.java:71)
	at com.vaadin.flow.component.polymertemplate.PolymerTemplate.<init>(PolymerTemplate.java:72)
	at com.vaadin.flow.component.polymertemplate.PolymerTemplate.<init>(PolymerTemplate.java:87)
	at com.avides.waresca.verify.ui.view.instruction.ScannerRepresenter.<init>(ScannerRepresenter.java:43)
	at com.avides.waresca.verify.ui.view.instruction.DefaultInstructionView.lambda$updateRegisteredScannerContainer$0(DefaultInstructionView.java:95)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at com.avides.waresca.verify.ui.view.instruction.DefaultInstructionView.updateRegisteredScannerContainer(DefaultInstructionView.java:95)
	at com.avides.waresca.verify.ui.view.instruction.DefaultInstructionView.displayLoginSuccessful(DefaultInstructionView.java:87)
	at com.avides.waresca.verify.ui.presenter.instruction.InstructionPresenter.handleLoginInstruction(InstructionPresenter.java:82)
	at com.avides.waresca.verify.ui.presenter.instruction.InstructionPresenter.handle(InstructionPresenter.java:67)
	at com.avides.waresca.verify.ui.presenter.instruction.InstructionPresenter.handle(InstructionPresenter.java:22)
	at com.avides.waresca.verify.ui.presenter.instruction.InstructionPresenter$$FastClassBySpringCGLIB$$8a48e722.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:747)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:112)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
	at com.avides.waresca.verify.ui.presenter.instruction.InstructionPresenter$$EnhancerBySpringCGLIB$$37ee290f.handle(<generated>)
	at com.avides.waresca.verify.listener.websocket.InstructionWebSocketListener.handle(InstructionWebSocketListener.java:28)
	at com.avides.waresca.verify.listener.websocket.InstructionWebSocketListener.handle(InstructionWebSocketListener.java:12)
	at com.avides.waresca.verify.listener.websocket.AbstractWebSocketListener.handleFrame(AbstractWebSocketListener.java:34)
	at com.avides.waresca.verify.listener.websocket.AbstractWebSocketListener$$FastClassBySpringCGLIB$$3cd55b30.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:747)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:112)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
	at com.avides.waresca.verify.listener.websocket.InstructionWebSocketListener$$EnhancerBySpringCGLIB$$d712160b.handleFrame(<generated>)
	at org.springframework.messaging.simp.stomp.DefaultStompSession.invokeHandler(DefaultStompSession.java:462)
	at org.springframework.messaging.simp.stomp.DefaultStompSession.handleMessage(DefaultStompSession.java:409)
	at org.springframework.web.socket.messaging.WebSocketStompClient$WebSocketTcpConnectionHandlerAdapter.handleMessage(WebSocketStompClient.java:344)
	at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.handleTextMessage(StandardWebSocketHandlerAdapter.java:113)
	at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.access$000(StandardWebSocketHandlerAdapter.java:42)
	at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:84)
	at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:81)
	at org.apache.tomcat.websocket.WsFrameBase.sendMessageText(WsFrameBase.java:395)
	at org.apache.tomcat.websocket.WsFrameBase.processDataText(WsFrameBase.java:495)
	at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:294)
	at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:133)
	at org.apache.tomcat.websocket.WsFrameClient.processSocketRead(WsFrameClient.java:95)
	at org.apache.tomcat.websocket.WsFrameClient.resumeProcessing(WsFrameClient.java:209)
	at org.apache.tomcat.websocket.WsFrameClient.access$300(WsFrameClient.java:31)
	at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.doResumeProcessing(WsFrameClient.java:186)
	at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:163)
	at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:148)
	at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
	at sun.nio.ch.Invoker$2.run(Invoker.java:218)
	at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Greetings!

From what I gather, in both of the cases VaadinService.getCurrent() returns null, thus the NullPointerException. Are you perhaps doing something outside of the UI thread?

-Olli

Yes, it’s updated from another thread. I’m trying to update the component with UI.access but its not working. Any idea what I do wrong?

I have build my application with the MVP pattern and want to update my UI on server side events. In example the user makes an action and after server response the ui has to be updated. Push is enabled.

Using UI.access sounds like it should be enough, unless I’m missing something. Can you create a small sample project that reproduces the issue?

-Olli

Hm. Interestingly enough, there are no mentions of VaadinService in the stacktrace you posted above. So, from Vaadin perspective it looks like you are trying to create components/views outside of HTTP request.

…Which probably should still be possible without NPEs, though? Unless I’m missing something?

I cannot reproduce the exception in my example. But in the end it’s not working as expected and it is similar to the code of my project. In that case I got one warning:

2018-03-20 11:45:51.434  WARN 22500 --- [nio-8080-exec-7]
 c.v.f.server.communication.PushHandler   : Invalid identifier in new connection received from 0:0:0:0:0:0:0:1

The difference to the code of my project with the exception is that I communicate with a server in the backend and send the results over the presenter to the view. This is in another thread. I simulate it with the call of new Thread(runnable) in the attached example.
17016814.zip (98.2 KB)

As far as I understand DefaultTemplateParser.getTemplateContent, the only reason it needs HTTP request is to get servlet context so that it can load template. I guess not much has changed when that method was extracted to TemplateInitializer in beta 3.

Potential workaround: Create the object in the regular UI thread and initialize it in the onAttach() method?

What for a object you mean? The beans are managed by spring and scoped with vaadin-ui @UIScope. The view has the default scope (vaadin-view?). The custom component has no spring magic and is created in the UI.access runnable where it will be added to the view too.

Oh, right, Spring managed beans. Try adding some delay to your example; I think its problem could be that the thread executes too quickly and it finishes in time for the original request to still be around.

Let me give you more information about the backend. The user put a code into a textfield in the view. Then the input will be validated and pushed to the server via a websocket connection with stomp (Spring Websocket). The server make some magic and give me a response message over the same websocket connection with stomp. The listener calls the presenter, then the presenter calls the view for updating the current UIScope instance of the view. Now it should be added a new component to the current view. But there the exception occurs.

Edit:
Detailed exception:

java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at com.vaadin.flow.server.FutureAccess.get(FutureAccess.java:61)
	at com.vaadin.flow.server.VaadinService.runPendingAccessTasks(VaadinService.java:1972)
	at com.vaadin.flow.server.VaadinSession.unlock(VaadinSession.java:621)
	at com.vaadin.flow.server.VaadinService.ensureAccessQueuePurged(VaadinService.java:1934)
	at com.vaadin.flow.server.VaadinService.accessSession(VaadinService.java:1900)
	at com.vaadin.flow.server.VaadinSession.access(VaadinSession.java:923)
	at com.vaadin.flow.component.UI.access(UI.java:444)
	at com.avides.waresca.verify.ui.presenter.instruction.InstructionPresenter.handle(InstructionPresenter.java:70)
	at com.avides.waresca.verify.ui.presenter.instruction.InstructionPresenter.handle(InstructionPresenter.java:24)
	at com.avides.waresca.verify.ui.presenter.instruction.InstructionPresenter$$FastClassBySpringCGLIB$$8a48e722.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:747)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:112)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
	at com.avides.waresca.verify.ui.presenter.instruction.InstructionPresenter$$EnhancerBySpringCGLIB$$e66e4481.handle(<generated>)
	at com.avides.waresca.verify.listener.websocket.InstructionWebSocketListener.handle(InstructionWebSocketListener.java:28)
	at com.avides.waresca.verify.listener.websocket.InstructionWebSocketListener.handle(InstructionWebSocketListener.java:12)
	at com.avides.waresca.verify.listener.websocket.AbstractWebSocketListener.handleFrame(AbstractWebSocketListener.java:34)
	at com.avides.waresca.verify.listener.websocket.AbstractWebSocketListener$$FastClassBySpringCGLIB$$3cd55b30.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:747)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:112)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
	at com.avides.waresca.verify.listener.websocket.InstructionWebSocketListener$$EnhancerBySpringCGLIB$$8592317d.handleFrame(<generated>)
	at org.springframework.messaging.simp.stomp.DefaultStompSession.invokeHandler(DefaultStompSession.java:462)
	at org.springframework.messaging.simp.stomp.DefaultStompSession.handleMessage(DefaultStompSession.java:409)
	at org.springframework.web.socket.messaging.WebSocketStompClient$WebSocketTcpConnectionHandlerAdapter.handleMessage(WebSocketStompClient.java:344)
	at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.handleTextMessage(StandardWebSocketHandlerAdapter.java:113)
	at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.access$000(StandardWebSocketHandlerAdapter.java:42)
	at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:84)
	at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:81)
	at org.apache.tomcat.websocket.WsFrameBase.sendMessageText(WsFrameBase.java:395)
	at org.apache.tomcat.websocket.WsFrameBase.processDataText(WsFrameBase.java:495)
	at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:294)
	at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:133)
	at org.apache.tomcat.websocket.WsFrameClient.processSocketRead(WsFrameClient.java:95)
	at org.apache.tomcat.websocket.WsFrameClient.resumeProcessing(WsFrameClient.java:209)
	at org.apache.tomcat.websocket.WsFrameClient.access$300(WsFrameClient.java:31)
	at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.doResumeProcessing(WsFrameClient.java:186)
	at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:163)
	at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:148)
	at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
	at sun.nio.ch.Invoker$2.run(Invoker.java:218)
	at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException: null
	at com.vaadin.flow.component.polymertemplate.DefaultTemplateParser.getTemplateContent(DefaultTemplateParser.java:84)
	at com.vaadin.flow.component.polymertemplate.TemplateDataAnalyzer.parseTemplate(TemplateDataAnalyzer.java:179)
	at com.vaadin.flow.component.polymertemplate.TemplateInitializer.<init>(TemplateInitializer.java:87)
	at com.vaadin.flow.component.polymertemplate.PolymerTemplate.<init>(PolymerTemplate.java:72)
	at com.vaadin.flow.component.polymertemplate.PolymerTemplate.<init>(PolymerTemplate.java:87)
	at com.avides.waresca.verify.ui.view.instruction.ScannerRepresenter.<init>(ScannerRepresenter.java:43)
	at com.avides.waresca.verify.ui.view.instruction.DefaultInstructionView.lambda$updateRegisteredScannerContainer$0(DefaultInstructionView.java:89)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at com.avides.waresca.verify.ui.view.instruction.DefaultInstructionView.updateRegisteredScannerContainer(DefaultInstructionView.java:89)
	at com.avides.waresca.verify.ui.view.instruction.DefaultInstructionView.displayLoginSuccessful(DefaultInstructionView.java:81)
	at com.avides.waresca.verify.ui.presenter.instruction.InstructionPresenter.handleLoginInstruction(InstructionPresenter.java:90)
	at com.avides.waresca.verify.ui.presenter.instruction.InstructionPresenter.lambda$handle$9f3cb4ad$1(InstructionPresenter.java:74)
	at com.vaadin.flow.component.UI.accessSynchronously(UI.java:383)
	at com.vaadin.flow.component.UI$1.execute(UI.java:447)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at com.vaadin.flow.server.VaadinService.runPendingAccessTasks(VaadinService.java:1969)
	... 49 common frames omitted

I’ve created a bug ticket about this in the repo: https://github.com/vaadin/flow/issues/3738 - we’ll see how it goes.

If you do manage to create a reproducable sample, attach it there.

-Olli

The problem is, that the current request by VaadinService.getCurrentRequest() is null in my ui.access(). The initial call for this action come from a asynch thread from the background. All called methods are wrapped into UI.access in my view and push is enabled too with @Push(transport = Transport.LONG_POLLING) in my main layout.

All beans are scoped as UIScope in the backend (services, repositories, event listeners, presenter).

The application flow:

  1. user make an action from the view
  2. after a couple of time an event comes from the server and will be displayed in the ui
  3. ui.access is used to update the current open view → failed

One interesting question: which UI are you calling access() on? That is, where are you getting the UI instance?

-Olli

I’m calling getUI().ifPresent(ui -> ui.access(() -> )) to do this. Another way I had tested was saving the UI from attachEvent.getUI to a global variable in the view class. But both not working.

I tried it now without an HTML template and get following error:

java.lang.RuntimeException: Push failed
	at com.vaadin.flow.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:194)
	at com.vaadin.flow.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:169)
	at com.vaadin.flow.component.UI.push(UI.java:558)
	at com.vaadin.flow.server.VaadinSession.unlock(VaadinSession.java:629)
	at com.vaadin.flow.server.VaadinService.ensureAccessQueuePurged(VaadinService.java:1934)
	at com.vaadin.flow.server.VaadinService.accessSession(VaadinService.java:1900)
	at com.vaadin.flow.server.VaadinSession.access(VaadinSession.java:923)
	at com.vaadin.flow.component.UI.access(UI.java:444)
	at com.avides.waresca.verify.ui.view.instruction.DefaultInstructionView.lambda$displayLoginSuccessful$0(DefaultInstructionView.java:107)
	at java.util.Optional.ifPresent(Optional.java:159)
	at com.avides.waresca.verify.ui.view.instruction.DefaultInstructionView.displayLoginSuccessful(DefaultInstructionView.java:104)
	at com.avides.waresca.verify.ui.presenter.instruction.InstructionPresenter.handleLoginInstruction(InstructionPresenter.java:87)
	at com.avides.waresca.verify.ui.presenter.instruction.InstructionPresenter.handle(InstructionPresenter.java:72)
	at com.avides.waresca.verify.ui.presenter.instruction.InstructionPresenter.handle(InstructionPresenter.java:22)
	at com.avides.waresca.verify.ui.presenter.instruction.InstructionPresenter$$FastClassBySpringCGLIB$$8a48e722.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:747)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:112)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
	at com.avides.waresca.verify.ui.presenter.instruction.InstructionPresenter$$EnhancerBySpringCGLIB$$7af79129.handle(<generated>)
	at com.avides.waresca.verify.listener.websocket.InstructionWebSocketListener.handle(InstructionWebSocketListener.java:28)
	at com.avides.waresca.verify.listener.websocket.InstructionWebSocketListener.handle(InstructionWebSocketListener.java:12)
	at com.avides.waresca.verify.listener.websocket.AbstractWebSocketListener.handleFrame(AbstractWebSocketListener.java:34)
	at com.avides.waresca.verify.listener.websocket.AbstractWebSocketListener$$FastClassBySpringCGLIB$$3cd55b30.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:747)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:112)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
	at com.avides.waresca.verify.listener.websocket.InstructionWebSocketListener$$EnhancerBySpringCGLIB$$1a1b7e25.handleFrame(<generated>)
	at org.springframework.messaging.simp.stomp.DefaultStompSession.invokeHandler(DefaultStompSession.java:462)
	at org.springframework.messaging.simp.stomp.DefaultStompSession.handleMessage(DefaultStompSession.java:409)
	at org.springframework.web.socket.messaging.WebSocketStompClient$WebSocketTcpConnectionHandlerAdapter.handleMessage(WebSocketStompClient.java:344)
	at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.handleTextMessage(StandardWebSocketHandlerAdapter.java:113)
	at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.access$000(StandardWebSocketHandlerAdapter.java:42)
	at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:84)
	at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:81)
	at org.apache.tomcat.websocket.WsFrameBase.sendMessageText(WsFrameBase.java:395)
	at org.apache.tomcat.websocket.WsFrameBase.processDataText(WsFrameBase.java:495)
	at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:294)
	at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:133)
	at org.apache.tomcat.websocket.WsFrameClient.processSocketRead(WsFrameClient.java:95)
	at org.apache.tomcat.websocket.WsFrameClient.resumeProcessing(WsFrameClient.java:209)
	at org.apache.tomcat.websocket.WsFrameClient.access$300(WsFrameClient.java:31)
	at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.doResumeProcessing(WsFrameClient.java:186)
	at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:163)
	at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:148)
	at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
	at sun.nio.ch.Invoker$2.run(Invoker.java:218)
	at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException: null
	at com.vaadin.flow.server.ServletHelper.getContextRootRelativePath(ServletHelper.java:188)
	at com.vaadin.flow.server.BootstrapHandler.getApplicationParameters(BootstrapHandler.java:892)
	at com.vaadin.flow.server.BootstrapHandler.access$000(BootstrapHandler.java:82)
	at com.vaadin.flow.server.BootstrapHandler$BootstrapUriResolver.getContextRootUrl(BootstrapHandler.java:344)
	at com.vaadin.flow.shared.VaadinUriResolver.processContextProtocol(VaadinUriResolver.java:89)
	at com.vaadin.flow.shared.VaadinUriResolver.resolveVaadinUri(VaadinUriResolver.java:60)
	at com.vaadin.flow.server.VaadinServlet.resolveUrl(VaadinServlet.java:713)
	at com.vaadin.flow.server.VaadinServlet.resourceIsFound(VaadinServlet.java:690)
	at com.vaadin.flow.server.VaadinServlet.computeUrlTranslation(VaadinServlet.java:682)
	at com.vaadin.flow.server.VaadinServlet.getUrlTranslation(VaadinServlet.java:634)
	at com.vaadin.flow.component.internal.UIInternals.getHtmlImportValue(UIInternals.java:813)
	at com.vaadin.flow.component.internal.UIInternals.lambda$addHtmlImport$3(UIInternals.java:807)
	at java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1548)
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
	at com.vaadin.flow.component.internal.UIInternals.addHtmlImport(UIInternals.java:807)
	at com.vaadin.flow.component.internal.UIInternals.lambda$addComponentDependencies$0(UIInternals.java:798)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
	at com.vaadin.flow.component.internal.UIInternals.addComponentDependencies(UIInternals.java:798)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at com.vaadin.flow.server.communication.UidlWriter.encodeChanges(UidlWriter.java:333)
	at com.vaadin.flow.server.communication.UidlWriter.createUidl(UidlWriter.java:138)
	at com.vaadin.flow.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:190)
	... 55 common frames omitted

It seems so I have general problems with Push. Here an example on how I use Push with Vaadin 10 and Spring Boot 2.

In this example I don’t get any exception, but the grid isn’t updated by the inbound event from the server.

I think this can have an relation to my other problem with the template.
17023663.zip (101 KB)