<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffffff">
Hi Pete,<br>
<br>
I'm looking at examples from <a
href="https://github.com/pmuir/jboss-as-developer-guide/tree/master/quickstarts">https://github.com/pmuir/jboss-as-developer-guide/tree/master/quickstarts</a>
and I have a question...<br>
There is org.jboss.as.quickstarts.login.EJBUserManager:<br>
<br>
<blockquote><i>...<br>
@Named("userManager")<br>
@RequestScoped<br>
@Alternative<br>
@Stateful<br>
public class EJBUserManager implements UserManager {<br>
...<br>
@Produces<br>
@Named<br>
@RequestScoped<br>
public List<User> getUsers() throws Exception {<br>
...<br>
}<br>
...<br>
}<br>
</i></blockquote>
<br>
It's an alternative bean class which declare a @Named producer.<br>
<br>
And there is also another bean
org.jboss.as.quickstarts.login.ManagedBeanUserManager:<br>
<br>
<blockquote><i>@Named("userManager")<br>
@RequestScoped<br>
public class ManagedBeanUserManager implements UserManager {<br>
<br>
@SuppressWarnings("unchecked")<br>
@Produces<br>
@Named<br>
@RequestScoped<br>
public List<User> getUsers() throws Exception {<br>
...<br>
}<br>
...<br>
}<br>
</i></blockquote>
<br>
So EL names of both bean classes ("userManager") are the same. This
is OK and JBoss Tools doesn't treat it as a problem because
EJBUserManager is an alternative.<br>
But EL names of the producers are treated as ambiguous EL names
("users").<br>
I looked at the spec. and still don't understand where our tooling
is wrong:<br>
<br>
<font color="#000099"><i>5.3.1. Ambiguous EL names<br>
An ambiguous EL name exists in an EL expression when an EL name
resolves to multiple beans. When an ambiguous EL<br>
name exists, the container attempts to resolve the ambiguity. If
any of the beans are alternatives, the container eliminates<br>
all beans that are not alternatives, <b>except for producer
methods and fields of beans that are alternatives</b>. If
there is exactly<br>
one bean remaining, the container will select this bean, and the
ambiguous EL name is called resolvable.</i></font><br>
<br>
Thanks.<br>
</body>
</html>