I am currently trying to switch from JBOSS Weld AS7 to Wildfly 8 Beta. I got it compiled but when trying to load the page itself I get the following exception:
Caused by: java.lang.IllegalStateException: class org.jboss.weld.context.SerializableContextualFactory$PassivationCapableSerializableContextual is no valid conversation scoped bean
at org.apache.myfaces.extensions.cdi.core.impl.scope.conversation.ConversationContextAdapter.get(ConversationContextAdapter.java:100) [myfaces-extcdi-bundle-jsf20-1.0.5.jar:1.0.5]
at org.jboss.weld.context.PassivatingContextWrapper$AbstractPassivatingContextWrapper.get(PassivatingContextWrapper.java:70) [weld-core-impl-2.1.0.CR1.jar:2013-09-26 16:53]
at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:81) [weld-core-impl-2.1.0.CR1.jar:2013-09-26 16:53]
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:78) [weld-core-impl-2.1.0.CR1.jar:2013-09-26 16:53]
at myprojectspace.project.OpenScenarioBean$Proxy$_$$_WeldClientProxy.getProjectList(Unknown Source) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_09]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_09]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_09]
at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_09]
at javax.el.BeanELResolver.getValue(BeanELResolver.java:363) [javax.el-3.0-b07.jar:3.0-b07]
The class, that causes this, i.e. OpenScenarioBean
is the backing bean for the main page and is declared as follows:
@Named
@ViewAccessScoped
public class OpenScenarioBean implements Serializable {
// ...
}
If I remove the ViewAccessScoped
and replace it with e.g. javax.enterprise.context.ConversationScoped
the web page will display without an exception.
Does anyone know how to fix this?
My guess is: CODI didn't yet do any integration with Wildfly, because during deployment I also receive a couple of warnings like
12:26:36,103 WARN [org.jboss.weld.Bean] (MSC service thread 1-7) WELD-001529: An
InjectionTarget is created for a class
org.apache.myfaces.extensions.cdi.jsf2.impl.listener.request.CodiFacesContextFactory which
does not have any appropriate constructor.
But if that's the case, and I want something like ViewAccessScoped
I guess I should switch to DeltaSpike and hope they're faster in the integration with Wildfly? (But that project is in a really early stage).
Looks like you have a Classloading issue with your setup.