Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-5150

Stack overflow with @Produces and @Inject in one ManagedBean

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • CDI / Weld
    • None

    Description

      This code

      @ManagedBean
      public class SimpleManagedBean {
      
          @Inject List<String> providers;
      
          @Produces
          public List<String> getPaymentProviders() {
              return Arrays.asList("Visa", "Paypal");
          }
      }
      

      lead to

      10:36:19,441 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/simple].[SimpleBeanServlet]] (http-/127.0.0.1:8080-1) Allocate exception for servlet SimpleBeanServlet: java.lang.StackOverflowError
      	at org.jboss.weld.manager.BeanManagerImpl.getId(BeanManagerImpl.java:932) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.manager.BeanManagerImpl.hashCode(BeanManagerImpl.java:855) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at java.util.HashMap.get(HashMap.java:300) [rt.jar:1.6.0_33]
      	at org.jboss.weld.util.BeansClosure.getClosure(BeansClosure.java:59) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.manager.BeanManagerImpl.getMostSpecializedBean(BeanManagerImpl.java:979) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:626) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:703) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:136) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:686) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:695) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed(ManagedBean.java:161) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1.work(ManagedBean.java:157) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.bean.ManagedBean$FixInjectionPoint.run(ManagedBean.java:131) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.inject(ManagedBean.java:153) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:293) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:68) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:637) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.bean.AbstractReceiverBean.getReceiver(AbstractReceiverBean.java:77) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.bean.AbstractProducerBean$AbstractProducer.produce(AbstractProducerBean.java:317) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:307) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:68) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:637) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:703) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:136) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:686) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:695) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed(ManagedBean.java:161) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1.work(ManagedBean.java:157) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.bean.ManagedBean$FixInjectionPoint.run(ManagedBean.java:131) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.inject(ManagedBean.java:153) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:293) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:68) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:637) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.bean.AbstractReceiverBean.getReceiver(AbstractReceiverBean.java:77) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      	at org.jboss.weld.bean.AbstractProducerBean$AbstractProducer.produce(AbstractProducerBean.java:317) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
      

      Attachments

        Activity

          People

            sdouglas1@redhat.com Stuart Douglas
            tdiesler@redhat.com Thomas Diesler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: