Denis Forveille created OWB-868:
-----------------------------------
Summary: Producer ArrayList<String> + producer List<Integer> =
j.e.i.AmbiguousResolutionException
Key: OWB-868
URL: https://issues.apache.org/jira/browse/OWB-868
Project: OpenWebBeans
Issue Type: Bug
Affects Versions: 1.1.8
Environment: J2SE + IBM JDK 7
Reporter: Denis Forveille
With this bean that provides 2 producers that return 2 differents kinds of
objects:
@Produces
@Named("list1")
public ArrayList<String> getListe1() {
return null;
}
@Produces
@Named("list2")
public List<Integer> getListe2() {
return null;
}
And this bean that get injected one of the produced object:
@Inject public List<Integer> listInteger;
The application fails with
"javax.enterprise.inject.AmbiguousResolutionException"
Exception in thread "main"
javax.enterprise.inject.AmbiguousResolutionException: Ambigious resolution
found beans:
List, Name:list2, WebBeans Type:PRODUCERMETHOD, API
Types:[java.lang.Iterable,java.lang.Object,java.util.Collection,java.util.List],
Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default,javax.inject.Named]
ArrayList, Name:list1, WebBeans Type:PRODUCERMETHOD, API
Types:[java.util.AbstractList,java.util.ArrayList,java.util.RandomAccess,java.lang.Iterable,java.util.AbstractCollection,java.util.Collection,java.lang.Object,java.io.Serializable,java.util.List,java.util.Collection,java.lang.Iterable,java.util.List,java.lang.Cloneable],
Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default,javax.inject.Named]
If we change the return type of the firts producer from ArrayList by List, it
works !!
Check the attached zip
--
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