java - Exception when clicking navigation button during render response phase -


i have jsf application using myfaces 2.2.8 , primefaces 5.2 running inside tomcat 8.0.23.

all pages built using facelets top menu , content area below. on pages content area takes bit longer render (multiple primefaces datatables inside primefaces accordion; accordion tabs rendered using c:foreach). when click menu in small timeframe when header rendered content area not, nullpointerexception.

the menuitem tag looks this:

<p:menuitem value="text" action="#{bean.dosomething()}" ajax="false"/> 

bean.dosomething() returns string navigation target.

the nullpointerexception occurs in org.apache.myfaces.view.facelets.el.faceletstatevalueexpression.getwrapped() line 73 because facescontext.getviewroot() returns null. value trying resolve ui:param set inside c:foreach.

here full stacktrace:

javax.servlet.servletexception: java.lang.nullpointerexception @ org.omnifaces.filter.facesexceptionfilter.dofilter(facesexceptionfilter.java:69) @ org.omnifaces.filter.httpfilter.dofilter(httpfilter.java:108) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ net.bull.javamelody.monitoringfilter.dofilter(monitoringfilter.java:198) @ net.bull.javamelody.monitoringfilter.dofilter(monitoringfilter.java:176) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ my.application.web.filter.filter.authorizationfilter.dofilter(authorizationfilter.java:85) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ my.application.web.filter.authenticationfilter.dofilter(authenticationfilter.java:52) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:219) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:106) @ org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:502) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:142) @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:79) @ org.apache.catalina.valves.abstractaccesslogvalve.invoke(abstractaccesslogvalve.java:617) @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:88) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:518) @ org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1091) @ org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:668) @ org.apache.tomcat.util.net.nioendpoint$socketprocessor.dorun(nioendpoint.java:1521) @ org.apache.tomcat.util.net.nioendpoint$socketprocessor.run(nioendpoint.java:1478) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run(taskthread.java:61) @ java.lang.thread.run(thread.java:745) caused by: java.lang.nullpointerexception @ org.apache.myfaces.view.facelets.el.faceletstatevalueexpression.getwrapped(faceletstatevalueexpression.java:73) @ org.apache.myfaces.view.facelets.el.faceletstatevalueexpression.getvalue(faceletstatevalueexpression.java:107) @ org.apache.el.parser.astidentifier.getvalue(astidentifier.java:74) @ org.apache.el.parser.astvalue.getvalue(astvalue.java:137) @ org.apache.el.parser.astdeferredexpression.getvalue(astdeferredexpression.java:43) @ org.apache.el.parser.astcompositeexpression.getvalue(astcompositeexpression.java:49) @ org.apache.el.valueexpressionimpl.getvalue(valueexpressionimpl.java:184) @ org.jboss.weld.el.weldvalueexpression.getvalue(weldvalueexpression.java:50) @ org.apache.myfaces.view.facelets.el.contextawaretagvalueexpression.getvalue(contextawaretagvalueexpression.java:96) @ org.apache.el.parser.astidentifier.getvalue(astidentifier.java:74) @ org.apache.el.valueexpressionimpl.getvalue(valueexpressionimpl.java:184) @ org.jboss.weld.el.weldvalueexpression.getvalue(weldvalueexpression.java:50) @ org.apache.myfaces.view.facelets.el.contextawaretagvalueexpression.getvalue(contextawaretagvalueexpression.java:96) @ org.apache.myfaces.view.facelets.tag.tagattributeimpl.getobject(tagattributeimpl.java:431) @ org.apache.myfaces.view.facelets.tag.tagattributeimpl.getvalue(tagattributeimpl.java:389) @ org.apache.myfaces.view.facelets.tag.jsf.componenttaghandlerdelegate.apply(componenttaghandlerdelegate.java:305) @ javax.faces.view.facelets.delegatingmetataghandler.apply(delegatingmetataghandler.java:50) @ org.apache.myfaces.view.facelets.tag.ui.compositionhandler.apply(compositionhandler.java:161) @ org.apache.myfaces.view.facelets.compiler.namespacehandler.apply(namespacehandler.java:59) @ org.apache.myfaces.view.facelets.compiler.encodinghandler.apply(encodinghandler.java:48) @ org.apache.myfaces.view.facelets.impl.defaultfacelet.include(defaultfacelet.java:521) @ org.apache.myfaces.view.facelets.impl.defaultfacelet.include(defaultfacelet.java:575) @ org.apache.myfaces.view.facelets.impl.defaultfacelet.include(defaultfacelet.java:553) @ org.apache.myfaces.view.facelets.impl.defaultfaceletcontext.includefacelet(defaultfaceletcontext.java:240) @ org.apache.myfaces.view.facelets.tag.ui.includehandler.apply(includehandler.java:228) @ javax.faces.view.facelets.delegatingmetataghandler.applynexthandler(delegatingmetataghandler.java:55) @ org.apache.myfaces.view.facelets.tag.jsf.componenttaghandlerdelegate.apply(componenttaghandlerdelegate.java:373) @ javax.faces.view.facelets.delegatingmetataghandler.apply(delegatingmetataghandler.java:50) @ org.apache.myfaces.view.facelets.tag.jstl.core.foreachhandler.applyfirsttime(foreachhandler.java:385) @ org.apache.myfaces.view.facelets.tag.jstl.core.foreachhandler.apply(foreachhandler.java:228) @ javax.faces.view.facelets.delegatingmetataghandler.applynexthandler(delegatingmetataghandler.java:55) @ org.apache.myfaces.view.facelets.tag.jsf.componenttaghandlerdelegate.apply(componenttaghandlerdelegate.java:373) @ javax.faces.view.facelets.delegatingmetataghandler.apply(delegatingmetataghandler.java:50) @ javax.faces.view.facelets.compositefacelethandler.apply(compositefacelethandler.java:46) @ org.apache.myfaces.view.facelets.tag.ui.compositionhandler.apply(compositionhandler.java:161) @ org.apache.myfaces.view.facelets.compiler.namespacehandler.apply(namespacehandler.java:59) @ org.apache.myfaces.view.facelets.compiler.encodinghandler.apply(encodinghandler.java:48) @ org.apache.myfaces.view.facelets.impl.defaultfacelet.include(defaultfacelet.java:521) @ org.apache.myfaces.view.facelets.impl.defaultfacelet.include(defaultfacelet.java:575) @ org.apache.myfaces.view.facelets.impl.defaultfacelet.include(defaultfacelet.java:553) @ org.apache.myfaces.view.facelets.impl.defaultfaceletcontext.includefacelet(defaultfaceletcontext.java:240) @ org.apache.myfaces.view.facelets.tag.ui.includehandler.apply(includehandler.java:228) @ javax.faces.view.facelets.compositefacelethandler.apply(compositefacelethandler.java:46) @ javax.faces.view.facelets.delegatingmetataghandler.applynexthandler(delegatingmetataghandler.java:55) @ org.apache.myfaces.view.facelets.tag.jsf.componenttaghandlerdelegate.apply(componenttaghandlerdelegate.java:373) @ javax.faces.view.facelets.delegatingmetataghandler.apply(delegatingmetataghandler.java:50) @ org.apache.myfaces.view.facelets.tag.ui.definehandler.applydefinition(definehandler.java:86) @ org.apache.myfaces.view.facelets.tag.ui.compositionhandler.apply(compositionhandler.java:178) @ org.apache.myfaces.view.facelets.impl.templatecontextimpl$templatemanagerimpl.apply(templatecontextimpl.java:193) @ org.apache.myfaces.view.facelets.impl.templatecontextimpl.includedefinition(templatecontextimpl.java:136) @ org.apache.myfaces.view.facelets.impl.defaultfaceletcontext.includedefinition(defaultfaceletcontext.java:476) @ org.apache.myfaces.view.facelets.tag.ui.inserthandler.apply(inserthandler.java:94) @ javax.faces.view.facelets.compositefacelethandler.apply(compositefacelethandler.java:46) @ javax.faces.view.facelets.delegatingmetataghandler.applynexthandler(delegatingmetataghandler.java:55) @ org.apache.myfaces.view.facelets.tag.jsf.componenttaghandlerdelegate.apply(componenttaghandlerdelegate.java:373) @ javax.faces.view.facelets.delegatingmetataghandler.apply(delegatingmetataghandler.java:50) @ javax.faces.view.facelets.compositefacelethandler.apply(compositefacelethandler.java:46) @ org.apache.myfaces.view.facelets.compiler.namespacehandler.apply(namespacehandler.java:59) @ javax.faces.view.facelets.compositefacelethandler.apply(compositefacelethandler.java:46) @ javax.faces.view.facelets.compositefacelethandler.apply(compositefacelethandler.java:46) @ org.apache.myfaces.view.facelets.compiler.encodinghandler.apply(encodinghandler.java:48) @ org.apache.myfaces.view.facelets.impl.defaultfacelet.include(defaultfacelet.java:521) @ org.apache.myfaces.view.facelets.impl.defaultfacelet.include(defaultfacelet.java:575) @ org.apache.myfaces.view.facelets.impl.defaultfacelet.include(defaultfacelet.java:553) @ org.apache.myfaces.view.facelets.impl.defaultfaceletcontext.includefacelet(defaultfaceletcontext.java:240) @ org.apache.myfaces.view.facelets.tag.ui.compositionhandler.apply(compositionhandler.java:151) @ org.apache.myfaces.view.facelets.compiler.namespacehandler.apply(namespacehandler.java:59) @ org.apache.myfaces.view.facelets.compiler.encodinghandler.apply(encodinghandler.java:48) @ org.apache.myfaces.view.facelets.impl.defaultfacelet.apply(defaultfacelet.java:189) @ org.apache.myfaces.view.facelets.faceletviewdeclarationlanguage.buildview(faceletviewdeclarationlanguage.java:477) @ org.omnifaces.viewhandler.restorableviewhandler.restoreview(restorableviewhandler.java:80) @ javax.faces.application.viewhandlerwrapper.restoreview(viewhandlerwrapper.java:82) @ org.apache.myfaces.lifecycle.restoreviewexecutor.execute(restoreviewexecutor.java:170) @ org.apache.myfaces.lifecycle.lifecycleimpl.executephase(lifecycleimpl.java:196) @ org.apache.myfaces.lifecycle.lifecycleimpl.execute(lifecycleimpl.java:143) @ javax.faces.webapp.facesservlet.service(facesservlet.java:198) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:291) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.omnifaces.filter.facesexceptionfilter.dofilter(facesexceptionfilter.java:63) ... 32 more 

i tried reproduce error small example (with , without primefaces), not able reproduce nullpointerexception. instead viewexpiredexception when trigger action during rendering. (maybe nullpointerexception sideeffect/aftereffect?)

here content of sample page (page1.xhtml):

<div id="header">     <h:form>         <h:commandbutton action="page2" value="to page 2" />     </h:form> </div> <div id="content">     <c:foreach var="item" items="#{testbean.list}">         click button!         <h:datatable />     </c:foreach> </div> 

testbean.getlist() returns list 100000 strings. button must clicked after "click button!" appears , before rendering/page loading completed. same error (viewexpiredexception) if replace c:foreach ui:repeat.

i tried remove ui:param causing nullpointerexception in application, error resource bundle not loaded. supports theory nullpointerexception (or ui:param) not real cause of error, sideeffect/symptom.

i use default settings apache myfaces (i.e. javax.faces.state_saving_method: server, javax.faces.partial_state_saving:true), error still occurs when partial_state_saving set false.

if other infos required please ask , provide them.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -