Skip to content
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.

NPE in ELFlash.get() on first request #4379

Open
spyrkob opened this issue Jul 26, 2018 · 0 comments
Open

NPE in ELFlash.get() on first request #4379

spyrkob opened this issue Jul 26, 2018 · 0 comments

Comments

@spyrkob
Copy link

spyrkob commented Jul 26, 2018

ELFlash.get throws NPE in clustered apps when trying to access flash scope on first request.

Reproducer: test.tar.gz

Steps to reproduce:

  1. Unzip & deploy attached app
  2. curl -i http://localhost:8080/test/getvar.xhtml

Result:
26-Jul-2018 11:06:59.383 SEVERE [http-nio-8080-exec-13] com.sun.faces.application.view.FaceletViewHandlingStrategy.handleRenderException Error Rendering View[/getvar.xhtml] javax.el.ELException: /getvar.xhtml: java.lang.NullPointerException at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:89) at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:83) at com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:211) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1908) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1908) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:491) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:194) at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:151) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:126) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:223) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:671) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NullPointerException at com.sun.faces.context.flash.ELFlash.get(ELFlash.java:420) 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 javax.el.BeanELResolver.invoke(BeanELResolver.java:158) at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:79) at org.apache.el.parser.AstValue.getValue(AstValue.java:159) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:190) at com.sun.faces.facelets.el.ELText$ELTextVariable.writeText(ELText.java:258) at com.sun.faces.facelets.el.ELText$ELTextComposite.writeText(ELText.java:165) at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:86) ... 33 more

Expected:
#{flash.get('var')} should return null since the variable has not been set.

@spyrkob spyrkob changed the title NPE in ELFlash.get() when accessing NPE in ELFlash.get() on first request Jul 26, 2018
spyrkob added a commit to spyrkob/jsf-mojarra that referenced this issue Jul 26, 2018
spyrkob added a commit to spyrkob/jsf-mojarra that referenced this issue Jul 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant