I am trying to figure out why I keep getting the error listed below.
I have reduced the page to 2 composite components.
One is a header and the other is a menu.
The problem seems to be related to the menu part.
I believe the problem is related to the menu, although I cannot consistently reproduce the error without a second composite component on the page.
I am using a <p:toolBar> with <p:menuButton> components, since there appears to be a problem with the <p:menuBar> not rendering hotizontally.
If I include more than one <p:menuButton> component, I consistently get the following error.
If I remove the second <p:menuButton> component, I do not get the error.
Any help is appreciated.
Thanks.
Error in server log:
Code: Select all
SEVERE: Error Rendering View[/HomePage.xhtml]
java.lang.IllegalStateException: PWC3999: Cannot create a session after the response has been committed
at org.apache.catalina.connector.Request.doGetSession(Request.java:2880)
at org.apache.catalina.connector.Request.getSession(Request.java:2577)
at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:920)
at com.sun.faces.context.ExternalContextImpl.getSession(ExternalContextImpl.java:155)
at com.sun.faces.renderkit.ServerSideStateHelper.writeState(ServerSideStateHelper.java:175)
at com.sun.faces.renderkit.ResponseStateManagerImpl.writeState(ResponseStateManagerImpl.java:122)
at com.sun.faces.application.StateManagerImpl.writeState(StateManagerImpl.java:166)
at com.sun.faces.application.view.WriteBehindStateWriter.flushToWriter(WriteBehindStateWriter.java:225)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:418)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
INFO: Exception when handling error trying to reset the response.
java.lang.IllegalStateException: PWC3999: Cannot create a session after the response has been committed
at org.apache.catalina.connector.Request.doGetSession(Request.java:2880)
...
Code: Select all
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:cc="http://java.sun.com/jsf/composite"
xmlns:p="http://primefaces.org/ui">
<!-- INTERFACE -->
<cc:interface>
</cc:interface>
<!-- IMPLEMENTATION -->
<cc:implementation>
<p:toolbar style="overflow: visible !important; z-index: 20;" >
<p:toolbarGroup align="left" >
<p:menuButton value="File" >
<p:menuitem value="New" icon="ui-icon ui-icon-contact" />
<p:menuitem value="Open" url="#" />
<p:menuitem value="Quit" url="#" />
</p:menuButton>
</p:toolbarGroup>
<p:toolbarGroup align="left" >
<p:menuButton value="Item 1" >
<p:menuitem value="New1" icon="ui-icon ui-icon-contact" />
<p:menuitem value="Open1" />
<p:menuitem value="Quit1" />
</p:menuButton >
</p:toolbarGroup>
<p:toolbarGroup align="left" >
<p:commandButton type="push" value="New" image="ui-icon-folder-open"/>
<p:commandButton type="push" value="Open" image="ui-icon-folder-open"/>
<p:separator />
<p:commandButton type="push" title="Save" image="ui-icon-disk"/>
<p:commandButton type="push" title="Delete" image="ui-icon-trash"/>
<p:commandButton type="push" title="Print" image="ui-icon-print"/>
</p:toolbarGroup>
</p:toolbar>
</cc:implementation>
</html>
Code: Select all
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:cc="http://java.sun.com/jsf/composite"
xmlns:p="http://primefaces.org/ui">
<!-- INTERFACE -->
<cc:interface>
</cc:interface>
<!-- IMPLEMENTATION -->
<cc:implementation>
<p:outputPanel styleClass="header" >
<p:outputPanel styleClass="headerCenter" >
<h:panelGrid columns="3" styleClass="headerUserInfo" >
<h:outputText value="" />
<h:outputText value="Company: Sunny Beaches" />
<h:outputText value="User: Ichabod Grabarkowitz" />
</h:panelGrid>
</p:outputPanel>
<p:outputPanel styleClass="headerLeft" >
<p:outputPanel styleClass="headerLogo" >
<h:outputText value="Logo goes here" />
</p:outputPanel>
</p:outputPanel>
<p:outputPanel styleClass="headerRight" >
<h:panelGrid columns="1" style="margin-top: 10px;" >
<p:outputPanel >
<h:commandLink value="Logout" style="padding-left: 10px; padding-right: 10px; color: #000000" />
<h:commandLink value="About" style="padding-left: 10px; padding-right: 10px; color: #000000" />
<h:commandLink value="Help" style="padding-left: 10px; padding-right: 10px; color: #000000" />
</p:outputPanel>
</h:panelGrid>
</p:outputPanel>
</p:outputPanel>
</cc:implementation>
</html>
Code: Select all
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:comp="http://java.sun.com/jsf/composite/ezcomp"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<body>
<ui:composition template="./LoginTemplate.xhtml">
<!-- ui:define name="top">
top
</ui:define -->
<!-- ui:define name="left">
<h:form>
<comp:menu id="menuComp" />
</h:form>
</ui:define -->
<ui:define name="content">
<h:form >
<comp:message id="messageComp" />
<comp:loginPanel id="loginComp" />
</h:form >
</ui:define>
</ui:composition>
</body>
</html>