我目前正在嘗試從JBOSS Weld AS7切換到Wildfly 8 Beta。我把它編譯但試圖加載頁面本身,我得到以下異常時:MyFaces CODI和Wildfly不能一起使用嗎?
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]
類,導致此,即OpenScenarioBean
是支持Bean的主網頁,並聲明如下:
@Named
@ViewAccessScoped
public class OpenScenarioBean implements Serializable {
// ...
}
如果我刪除ViewAccessScoped
並用eg替換它javax.enterprise.context.ConversationScoped
網頁將顯示無例外。
有誰知道如何解決這個問題?
我的猜測是:CODI還不做Wildfly任何整合,因爲在部署過程中我也收到一些警告象
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.
但是,如果是那樣的話,我想是這樣ViewAccessScoped
我我猜應該切換到DeltaSpike,並希望它們與Wildfly的整合速度更快? (但該項目處於非常早期的階段)。