gpt4 book ai didi

jsf - java.lang.ClassCastException:com.sun.faces.facelets.compiler.UIInstructions无法转换为org.primefaces.model.menu.MenuElement

转载 作者:行者123 更新时间:2023-12-03 13:39:29 26 4
gpt4 key购买 nike

今天早上,我来到办公室,发现的第一件事:公司网站崩溃了。因为我,我想。

现在,我花了一个半小时的时间来解决此问题,但我什么也没发现,每个人都失去了主意,因为该网站无法正常工作,我也无法修复(我一个人。该网站的创建者不见了,或者在假期)。所以我希望你能帮助我!

当我调用网站的dashboard.xhtml时,出现此异常。

java.lang.ClassCastException: com.sun.faces.facelets.compiler.UIInstructions cannot be cast to org.primefaces.model.menu.MenuElement

我的问题是:总体而言,我自己做的文件都没有。所以我真的不知道我的错误到底在哪里。

你能帮助我吗?

以下是一些其他信息:

整体异常(exception):
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)

整个dashborad文件:
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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">

<ui:define name="heading">
<h:outputText value="Dashboard" />
</ui:define>

<ui:define name="caption">
<p>List of all your configurations and enabled containers.</p>
</ui:define>

<ui:define name="main">
<div id="main">

<div class="page_margins">
<div class="page">
<h:form id="form">
<p:panel header="Meine Projekte" rendered="#{personManagementBean.loggedIn}">

<p:growl id="msgs" showDetail="true" />

<p:dataTable id="ownerProjects" var="p" value="#{projectManagementBean.ownerProjects}" tableStyle="width:100%" emptyMessage="Keine Projekte vorhanden">

<p:column headerText="Projektk&uuml;rzel" style="width:100px">
<h:outputText value="#{p.projectId}" />
</p:column>

<p:column headerText="Dom&auml;ne" style="width:80px">
<h:outputText value="#{p.domain}" />
</p:column>
<p:column headerText="Sub-Dom&auml;ne" style="width:80px">
<h:outputText value="#{p.subDomain}" />
</p:column>

<p:column headerText="Beschreibung">
<h:outputText value="#{p.description}" />
</p:column>

<p:column style="width:40px">
<p:panelGrid columns="2" styleClass="no-column-borders" cellpadding="2">
<p:commandButton id="selectButton" update=":form:display" oncomplete="projectDialog.show()" icon="ui-icon-search" title="Anzeigen"
actionListener="#{projectManagementBean.loadProject(p.projectId)}">
</p:commandButton>
<p:commandButton id="editButton" update=":form:display" icon="ui-icon-pencil" title="Anpassen" oncomplete="editProjectDialog.show()"
actionListener="#{projectManagementBean.loadProject(p.projectId)}">
</p:commandButton>
</p:panelGrid>
</p:column>
</p:dataTable>

</p:panel>

<p:panel header="Meine Entwicklungsprojekte" rendered="#{personManagementBean.loggedIn}" style="margin-top:10px">

<p:dataTable id="developperProjects" var="p" value="#{projectManagementBean.developperProjects}" rendered="#{personManagementBean.loggedIn}" tableStyle="width:100%"
emptyMessage="Keine Projekte vorhanden">

<p:column headerText="Projektk&uuml;rzel" style="width:100px">
<h:outputText value="#{p.projectId}" />
</p:column>

<p:column headerText="Dom&auml;ne" style="width:80px">
<h:outputText value="#{p.domain}" />
</p:column>
<p:column headerText="Sub-Dom&auml;ne" style="width:80px">
<h:outputText value="#{p.subDomain}" />
</p:column>

<p:column headerText="Beschreibung">
<h:outputText value="#{p.description}" />
</p:column>

<p:column style="width:40px">
<p:panelGrid columns="3" styleClass="no-column-borders" cellpadding="2">
<p:commandButton id="selectButton" update=":form:display" oncomplete="projectDialog.show()" icon="ui-icon-search" title="Anzeigen"
actionListener="#{projectManagementBean.loadProject(p.projectId)}">
</p:commandButton>
</p:panelGrid>
</p:column>
</p:dataTable>
</p:panel>

<ui:include src="./project/details.xhtml" />
<ui:include src="./project/editdetails.xhtml" />
</h:form>
</div>
</div>
</div>
</ui:define>

</ui:composition>

最佳答案

错误消息的快速谷歌显示

PanelMenu can't be rendered when it's sub elements contain comments. a html alert dialog will be shown on which written "UI Layout Initialization Error..." and on the server an exception is thrown "java.lang.ClassCastException:com.sun.faces.facelets.compiler.UIInstructions cannot be cast to org.primefaces.model.menu.MenuElement".

关于jsf - java.lang.ClassCastException:com.sun.faces.facelets.compiler.UIInstructions无法转换为org.primefaces.model.menu.MenuElement,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20188092/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com