web-dev-qa-db-ja.com

java.lang.ClassCastException:com.Sun.faces.facelets.compiler.UIInstructionsをorg.primefaces.model.menu.MenuElementにキャストできません

今朝、私は自分のオフィスに入り、最初に目にしたのは、会社のサイトがクラッシュしたことです。私のせいだと思います。

現在、1時間半、これを修正しようとしましたが、何も見つかりませんでした。Webサイトが機能せず、修正できないため(私は一人です。サイトの作成者が行っていないか、休暇中)。だから私はあなたが私を助けることができることを願っています!

私のウェブサイトのdashboard.xhtmlを呼び出すと、この例外が発生します。

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

私の問題は、次のとおりです。全体として、私が自分で作成したファイルはどこにもありません。だから私は本当に私のエラーがどこにあるのか本当にわかりません。

手伝って頂けますか?

追加情報は次のとおりです。

例外:

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)

ダッシュボードファイル全体:

<!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>
19
user1713847

エラーメッセージの簡単なグーグルが表示されます

サブメニューにコメントが含まれている場合、PanelMenuをレンダリングできません。 「UIレイアウト初期化エラー...」と書かれたHTML警告ダイアログが表示され、サーバーで例外がスローされます「Java.lang.ClassCastException:com.Sun.faces.facelets.compiler.UIInstructionsを組織にキャストできません.primefaces.model.menu.MenuElement」です。

17
Scary Wombat

これをweb.xmlに追加するだけです:

<context-param>
   <param-name>facelets.SKIP_COMMENTS</param-name>
   <param-value>true</param-value>
</context-param>

レンダリング中にJSFのコメントをスキップします。

34
Michael

これをweb.xmlに追加するだけです。

<context-param>
    <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
    <param-value>true</param-value>
</context-param>

レンダリング中にJSFのコメントをスキップします。

JSF1025以降、facelets.SKIP_COMMENTS非推奨 になっています。

10
user1553728

以下を設定してみてください:

<context-param>  
    <param-name>primefaces.THEME</param-name>  
    <param-value>blitzer</param-value>  
</context-param>