简体   繁体   中英

ClassCastException during primefaces upgrade

people!

I'm trying to upgrade a maven dependecy on my project, from primefaces-3.3 to 4.0.

I'm using jboss-6.1.0.Final as server.

The server starts without error and shows the first page of my web application but when I try to login, the following error shows up in the console:

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) [:4.0]
at org.primefaces.component.tieredmenu.TieredMenuRenderer.encodeMenu(TieredMenuRenderer.java:78) [:4.0]
at org.primefaces.component.menubar.MenubarRenderer.encodeMarkup(MenubarRenderer.java:49) [:4.0]
at org.primefaces.component.menu.BaseMenuRenderer.encodeEnd(BaseMenuRenderer.java:105) [:4.0]
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) [:2.1.9-]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786) [:2.1.9-]
at javax.faces.render.Renderer.encodeChildren(Renderer.java:168) [:2.1.9-]
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) [:2.1.9-]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779) [:2.1.9-]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) [:2.1.9-]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) [:2.1.9-]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) [:2.1.9-]
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:424) [:2.1.9-]
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125) [:2.1.9-]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) [:2.1.9-]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) [:2.1.9-]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) [:2.1.9-]
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) [:2.1.9-]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [:2.1.9-]
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [:2.1.9-]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) [:2.1.9-]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.1.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.1.0.Final]
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:98) [:4.0]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.1.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.1.0.Final]
at br.com.cabal.multibeneficios.util.EncondingFilter.doFilter(EncondingFilter.java:31) [:]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.1.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.1.0.Final]
at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67) [:6.1.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.1.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.1.0.Final]
at br.com.cabal.multibeneficios.listener.Autorizador.doFilter(Autorizador.java:24) [:]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.1.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.1.0.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.1.0.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [:6.1.0.Final]
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.1.0.Final]
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.1.0.Final]
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.1.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159) [:6.1.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.1.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.1.0.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.1.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.1.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.1.0.Final]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.1.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.1.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.1.0.Final]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_35]

At first, the page wasn't even loading, but the following line in the web.xml solved that:

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

I'm still stuck with it, though. Any help will be greatly appreciated.

I removed the whole menu from my application and everything worked. Then I started to put the menu back, section by section, and found a little piece of garbage (a "/>" out of place). With that out of the way, everything is just fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM