在primefaces升级期间ClassCastException

时间:2014-03-17 20:42:55

标签: maven primefaces

人!

我正在尝试升级我的项目中的maven依赖,从primefaces-3.3升级到4.0。

我正在使用jboss-6.1.0.Final作为服务器。

服务器启动时没有错误显示我的Web应用程序的第一页但是当我尝试登录时,控制台中显示以下错误:

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]

首先,页面甚至没有加载,但是web.xml中的以下行解决了:

    <context-param>
    <param-name>facelets.SKIP_COMMENTS</param-name>
    <param-value>true</param-value>
</context-param>
但是,我仍然坚持使用它。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

我从我的应用程序中删除了整个菜单,一切正常。 然后我开始逐个放回菜单,发现一小块垃圾(“/&gt;”不合适)。 除此之外,一切都很好。