Here is the situation.
I've got the following interfaces:
public interface Parent { }
public interface ChildOne extends Parent { }
public interface ChildTwo extends Parent { }
and 2 EJBs:
@Stateless
public class FirstBean implements ChildOne { }
@Stateless
public class SecondBean implements ChildTwo { }
And also this CDI Bean:
@Named
@SessionScoped
public class TestController implements Serializable {
@Inject
private FirstBean firstBean;
@Inject
private SecondBean secondBean;
}
While trying to deploy this on Glassfish 3.1 I get the following exception:
Exception while loading the app : WELD-001408 Unsatisfied dependencies for type [FirstBean]
with qualifiers [@Default] at injection point [[field] @Inject private com.test.controllers.TestController.firstBean]
org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [FirstBean]
with qualifiers [@Default] at injection point [[field] @Inject private com.test.controllers.TestController.firstBean]
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:305)
When both EJBs implement the Parent
interface, the exception is the same.
Also, I tried adding qualifiers, but that didn't change anything.