[
https://issues.jboss.org/browse/AS7-5150?page=com.atlassian.jira.plugin.s...
]
Stuart Douglas resolved AS7-5150.
---------------------------------
Resolution: Won't Fix
This is a user error, and even though it would be good to be able to detect this at
deployment time I can't really see any easy way to do this.
At this stage I don't think the amount of work that would be involved justifies the
benefit.
Stack overflow with @Produces and @Inject in one ManagedBean
------------------------------------------------------------
Key: AS7-5150
URL:
https://issues.jboss.org/browse/AS7-5150
Project: Application Server 7
Issue Type: Bug
Components: CDI / Weld
Reporter: Thomas Diesler
Assignee: Stuart Douglas
This code
{code}
@ManagedBean
public class SimpleManagedBean {
@Inject List<String> providers;
@Produces
public List<String> getPaymentProviders() {
return Arrays.asList("Visa", "Paypal");
}
}
{code}
lead to
{code}
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]
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira