title: java.lang.ClassCastException: com.sun.faces.facelets.compiler.UIInstructions cannot be cast to org.primefaces.model.menu.MenuElement
body: <p>This morning I came in to my office and the first thing I saw: my company site crashed. Because of me I think.</p>
  
  <p>Now I tried for one hour and a half to fix this, but I found nothing and everybody looses their mind because the website doesn't work and I can't fix it (i'm alone. The creators of the site are gone or in holidays). So I hope you can help me out!</p>
  
  <p>I get this exception, when I call the dashboard.xhtml of my website.</p>
  
  <pre><code>java.lang.ClassCastException: com.sun.faces.facelets.compiler.UIInstructions cannot be cast to org.primefaces.model.menu.MenuElement
  </code></pre>
  
  <p>My problem is: in the whole exception, nowhere is a file which I done by myself. So I really don't know where exactly my error is. </p>
  
  <p>Can you help me?</p>
  
  <p>Here are some additional informations:</p>
  
  <p>Whole exception:</p>
  
  <pre><code>SEVERE: Error Rendering View[/WEB-INF/flows/dashboard/dashboard.xhtml]
  java.lang.ClassCastException: com.sun.faces.facelets.compiler.UIInstructions cannot be cast to org.primefaces.model.menu.MenuElement
  at org.primefaces.component.tieredmenu.TieredMenuRenderer.encodeElements(TieredMenuRenderer.java:97)
  at org.primefaces.component.tieredmenu.TieredMenuRenderer.encodeSubmenu(TieredMenuRenderer.java:162)
  at org.primefaces.component.tieredmenu.TieredMenuRenderer.encodeElements(TieredMenuRenderer.java:119)
  at org.primefaces.component.tieredmenu.TieredMenuRenderer.encodeMenu(TieredMenuRenderer.java:78)
  at org.primefaces.component.menubar.MenubarRenderer.encodeMarkup(MenubarRenderer.java:49)
  at org.primefaces.component.menu.BaseMenuRenderer.encodeEnd(BaseMenuRenderer.java:105)
  at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
  at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
  at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
  at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
  at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125)
  at org.springframework.faces.webflow.FlowViewHandler.renderView(FlowViewHandler.java:99)
  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 org.springframework.faces.webflow.FlowLifecycle.render(FlowLifecycle.java:80)
  at org.springframework.faces.webflow.JsfView.render(JsfView.java:89)
  at org.springframework.webflow.engine.ViewState.render(ViewState.java:296)
  at org.springframework.webflow.engine.ViewState.refresh(ViewState.java:243)
  at org.springframework.webflow.engine.ViewState.resume(ViewState.java:221)
  at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
  at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:258)
  at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:169)
  at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183)
  at org.springframework.faces.webflow.JsfFlowHandlerAdapter.handle(JsfFlowHandlerAdapter.java:48)
  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
  at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
  at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
  at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
  at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
  at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
  at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
  at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
  at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
  at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
  at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
  at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
  at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
  at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
  at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
  at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
  at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  at java.lang.Thread.run(Thread.java:722)
  </code></pre>
  
  <p>whole dashborad file:</p>
  
  <pre><code>&lt;!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core" template="../../layouts/100.xhtml"&gt;
  
      &lt;ui:define name="heading"&gt;
          &lt;h:outputText value="Dashboard" /&gt;
      &lt;/ui:define&gt;
  
      &lt;ui:define name="caption"&gt;
          &lt;p&gt;List of all your configurations and enabled containers.&lt;/p&gt;
      &lt;/ui:define&gt;
  
      &lt;ui:define name="main"&gt;
          &lt;div id="main"&gt;
  
              &lt;div class="page_margins"&gt;
                  &lt;div class="page"&gt;
                      &lt;h:form id="form"&gt;
                          &lt;p:panel header="Meine Projekte" rendered="#{personManagementBean.loggedIn}"&gt;
  
                              &lt;p:growl id="msgs" showDetail="true" /&gt;
  
                              &lt;p:dataTable id="ownerProjects" var="p" value="#{projectManagementBean.ownerProjects}" tableStyle="width:100%" emptyMessage="Keine Projekte vorhanden"&gt;
  
                                  &lt;p:column headerText="Projektk&amp;uuml;rzel" style="width:100px"&gt;
                                      &lt;h:outputText value="#{p.projectId}" /&gt;
                                  &lt;/p:column&gt;
  
                                  &lt;p:column headerText="Dom&amp;auml;ne" style="width:80px"&gt;
                                      &lt;h:outputText value="#{p.domain}" /&gt;
                                  &lt;/p:column&gt;
                                  &lt;p:column headerText="Sub-Dom&amp;auml;ne" style="width:80px"&gt;
                                      &lt;h:outputText value="#{p.subDomain}" /&gt;
                                  &lt;/p:column&gt;
  
                                  &lt;p:column headerText="Beschreibung"&gt;
                                      &lt;h:outputText value="#{p.description}" /&gt;
                                  &lt;/p:column&gt;
  
                                  &lt;p:column style="width:40px"&gt;
                                      &lt;p:panelGrid columns="2" styleClass="no-column-borders" cellpadding="2"&gt;
                                          &lt;p:commandButton id="selectButton" update=":form:display" oncomplete="projectDialog.show()" icon="ui-icon-search" title="Anzeigen"
                                              actionListener="#{projectManagementBean.loadProject(p.projectId)}"&gt;
                                          &lt;/p:commandButton&gt;
                                          &lt;p:commandButton id="editButton" update=":form:display" icon="ui-icon-pencil" title="Anpassen" oncomplete="editProjectDialog.show()"
                                              actionListener="#{projectManagementBean.loadProject(p.projectId)}"&gt;
                                          &lt;/p:commandButton&gt;
                                      &lt;/p:panelGrid&gt;
                                  &lt;/p:column&gt;
                              &lt;/p:dataTable&gt;
  
                          &lt;/p:panel&gt;
  
                          &lt;p:panel header="Meine Entwicklungsprojekte" rendered="#{personManagementBean.loggedIn}" style="margin-top:10px"&gt;
  
                              &lt;p:dataTable id="developperProjects" var="p" value="#{projectManagementBean.developperProjects}" rendered="#{personManagementBean.loggedIn}" tableStyle="width:100%"
                                  emptyMessage="Keine Projekte vorhanden"&gt;
  
                                  &lt;p:column headerText="Projektk&amp;uuml;rzel" style="width:100px"&gt;
                                      &lt;h:outputText value="#{p.projectId}" /&gt;
                                  &lt;/p:column&gt;
  
                                  &lt;p:column headerText="Dom&amp;auml;ne" style="width:80px"&gt;
                                      &lt;h:outputText value="#{p.domain}" /&gt;
                                  &lt;/p:column&gt;
                                  &lt;p:column headerText="Sub-Dom&amp;auml;ne" style="width:80px"&gt;
                                      &lt;h:outputText value="#{p.subDomain}" /&gt;
                                  &lt;/p:column&gt;
  
                                  &lt;p:column headerText="Beschreibung"&gt;
                                      &lt;h:outputText value="#{p.description}" /&gt;
                                  &lt;/p:column&gt;
  
                                  &lt;p:column style="width:40px"&gt;
                                      &lt;p:panelGrid columns="3" styleClass="no-column-borders" cellpadding="2"&gt;
                                          &lt;p:commandButton id="selectButton" update=":form:display" oncomplete="projectDialog.show()" icon="ui-icon-search" title="Anzeigen"
                                              actionListener="#{projectManagementBean.loadProject(p.projectId)}"&gt;
                                          &lt;/p:commandButton&gt;
                                      &lt;/p:panelGrid&gt;
                                  &lt;/p:column&gt;
                              &lt;/p:dataTable&gt;
                          &lt;/p:panel&gt;
  
                          &lt;ui:include src="./project/details.xhtml" /&gt;
                          &lt;ui:include src="./project/editdetails.xhtml" /&gt;
                      &lt;/h:form&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/ui:define&gt;
  
  &lt;/ui:composition&gt;
  </code></pre>