]
Stan Silvert closed WFLY-848.
-----------------------------
Resolution: Out of Date
Problem using MyFaces + CODI
----------------------------
Key: WFLY-848
URL:
https://issues.jboss.org/browse/WFLY-848
Project: WildFly
Issue Type: Bug
Components: JSF
Reporter: Rich DiCroce
Assignee: Stan Silvert
Labels: cdi, myfaces
I have been experimenting with the dormant support for MyFaces added by AS7-5649. After
setting up a recent JBoss snapshot build (#1292) as described in that issue (adding
commons-digester, myfaces-api, and myfaces-impl to modules), I attempted to use my
application. It deploys successfully (which is a big step, before it failed due to
AS7-5849 / AS7-1628), but as soon as I try to log in, it blows up with this stack trace:
{code}
12:31:56,371 ERROR [com.lapis.cerberus.portal.exception.ExceptionHandlingFilter.Full]
(http-localhost/127.0.0.1:8080-20) Exception ID 6183872498:
java.lang.IllegalStateException: Error restoring component: j_id1
at
org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreStateFromMap(DefaultFaceletsStateManagementStrategy.java:665)
[myfaces-impl-2.1.9.jar:2.1.9]
at
org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreStateFromMap(DefaultFaceletsStateManagementStrategy.java:680)
[myfaces-impl-2.1.9.jar:2.1.9]
at
org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreStateFromMap(DefaultFaceletsStateManagementStrategy.java:696)
[myfaces-impl-2.1.9.jar:2.1.9]
at
org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreView(DefaultFaceletsStateManagementStrategy.java:330)
[myfaces-impl-2.1.9.jar:2.1.9]
at
org.apache.myfaces.application.StateManagerImpl.restoreView(StateManagerImpl.java:130)
[myfaces-impl-2.1.9.jar:2.1.9]
at
org.apache.myfaces.shared.view.ViewDeclarationLanguageBase.restoreView(ViewDeclarationLanguageBase.java:106)
[myfaces-impl-2.1.9.jar:2.1.9]
at
org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.restoreView(FaceletViewDeclarationLanguage.java:2118)
[myfaces-impl-2.1.9.jar:2.1.9]
at org.apache.myfaces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:300)
[myfaces-impl-2.1.9.jar:2.1.9]
at
com.ocpsoft.pretty.faces.application.PrettyViewHandler.restoreView(PrettyViewHandler.java:109)
[prettyfaces-jsf2-3.3.3.jar:]
at
org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.WindowContextAwareViewHandler.restoreView(WindowContextAwareViewHandler.java:122)
[myfaces-extcdi-jsf20-module-impl-1.0.5.jar:1.0.5]
at
org.apache.myfaces.extensions.cdi.jsf.impl.CodiViewHandler.restoreView(CodiViewHandler.java:99)
[myfaces-extcdi-jsf20-module-impl-1.0.5.jar:1.0.5]
at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:83)
[myfaces-api-2.1.9.jar:2.1.9]
at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:83)
[myfaces-api-2.1.9.jar:2.1.9]
at
org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:127)
[myfaces-impl-2.1.9.jar:2.1.9]
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170)
[myfaces-impl-2.1.9.jar:2.1.9]
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
[myfaces-impl-2.1.9.jar:2.1.9]
at
org.apache.myfaces.extensions.cdi.jsf2.impl.listener.phase.CodiLifecycleWrapper.execute(CodiLifecycleWrapper.java:95)
[myfaces-extcdi-jsf20-module-impl-1.0.5.jar:1.0.5]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
[myfaces-api-2.1.9.jar:2.1.9]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at
org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
[weld-core-1.1.10.Final.jar:2012-10-12 10:00]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
[prettyfaces-jsf2-3.3.3.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at
org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)
[solder-impl-3.1.0.Final.jar:3.1.0.Final]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at
org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)
[solder-impl-3.1.0.Final.jar:3.1.0.Final]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
[primefaces-3.4.1.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at
com.lapis.cerberus.portal.exception.ExceptionHandlingFilter.doFilter(ExceptionHandlingFilter.java:71)
[classes:]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at
org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.event(JBossWebContext.java:67)
at
org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.invoke(JBossWebContext.java:48)
at
org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
[jboss-as-jpa-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at
org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
[jboss-as-jpa-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
[jboss-as-web-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:350)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:900)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at org.apache.tomcat.util.net.NioEndpoint$ChannelProcessor.run(NioEndpoint.java:1025)
[jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_09]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_09]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_09]
Caused by: java.lang.ClassCastException: javax.faces.component.UIViewRoot$ViewScope
cannot be cast to javax.faces.convert.Converter
at javax.faces.component.UIOutput.restoreState(UIOutput.java:248)
[myfaces-api-2.1.9.jar:2.1.9]
at
org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreStateFromMap(DefaultFaceletsStateManagementStrategy.java:661)
[myfaces-impl-2.1.9.jar:2.1.9]
... 54 more
{code}
After some experimentation, I determined that this is due to the use of the MyFaces CODI
extensions in the project. If I remove the CODI libraries from the project (which is
doable because it is only used in a few places, but not ideal), I do not get this
exception. CODI has been tested against MyFaces, and I cannot find anyone else
experiencing this problem, so I believe JBoss (or perhaps Weld) is doing something that
CODI does not expect.