myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From titou10 titou10 <titou10.tito...@gmail.com>
Subject [CODI] ConversationScope producer in a ConversationScope bean = endless loop
Date Tue, 04 Jun 2013 14:49:15 GMT
When we declare a CODI ConversationScope producer in a CODI
ConversationScope bean, and we reference the object created by the
producer in a facelets page, the server enters an endless loop and
ends up with a StackOverFlowError

With this bean:
@Named("convScopeproducerInConvScopeBean")
@ConversationScoped
public class ConvScopeproducerInConvScopeBean implements Serializable {
   private static final long serialVersionUID = 1L;
  @Produces  @ConversationScoped  @Named("getConvScopeList")
   public ArrayList<String> getConversationScopeList() {
      ArrayList<String> res = new ArrayList<>();
      res.add("dummy string");
      return res;
   }
}

And this in a xhtml page: Size of list :  #{getConvScopeList.size()}

The repeated part of the exception stacktrace is :
...
at org.apache.webbeans.inject.InjectableMethods.doInjection(InjectableMethods.java:205)
at org.apache.webbeans.component.ProducerMethodBean.createDefaultInstance(ProducerMethodBean.java:204)
at org.apache.webbeans.component.ProducerMethodBean.createInstance(ProducerMethodBean.java:166)
at org.apache.webbeans.component.AbstractOwbBean.createNewInstance(AbstractOwbBean.java:216)
at org.apache.webbeans.portable.creation.AbstractProducer.produce(AbstractProducer.java:82)
at org.apache.webbeans.component.InjectionTargetWrapper.produce(InjectionTargetWrapper.java:142)
at org.apache.webbeans.component.AbstractOwbBean.create(AbstractOwbBean.java:174)
at org.apache.webbeans.container.SerializableBean.create(SerializableBean.java:128)
at org.apache.myfaces.extensions.cdi.core.impl.util.CodiUtils.createNewInstanceOfBean(CodiUtils.java:69)
at org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.AbstractConversationBeanEntry.createNewBeanInstance(AbstractConversationBeanEntry.java:139)
at org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.AbstractConversationBeanEntry.getBeanInstance(AbstractConversationBeanEntry.java:84)
at org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.DefaultConversation.getBean(DefaultConversation.java:163)
at org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.GroupedConversationContext.resolveBeanInstance(GroupedConversationContext.java:185)
at org.apache.myfaces.extensions.cdi.core.impl.scope.conversation.AbstractGroupedConversationContext.resolve(AbstractGroupedConversationContext.java:114)
at org.apache.myfaces.extensions.cdi.core.impl.scope.conversation.ConversationContextAdapter.get(ConversationContextAdapter.java:98)
at org.apache.webbeans.context.CustomContextImpl.get(CustomContextImpl.java:48)
at org.apache.webbeans.context.CustomPassivatingContextImpl.get(CustomPassivatingContextImpl.java:47)
at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.getContextualInstance(NormalScopedBeanInterceptorHandler.java:127)
at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.invoke(NormalScopedBeanInterceptorHandler.java:95)
at com.test.ConvScopeproducerInConvScopeBean_$$_javassist_154.getConversationScopeList(ConvScopeproducerInConvScopeBean_$$_javassist_154.java)
...

It seems to be a bug or maybe I'm not using correctly the
framework..Should I create a JIRA?
Works well with the CDI ConversatioScope or other scopes or if the
bean is not in the CODI ConversationScope..

We are using CODI v1.0.5 in WebSphere v8.5.0.2
I have a very simple test app if someone is interested

Mime
View raw message