My configuration is: Wildfly 8.2.0, Weld
Is it possible to inject in bean and not in its interface in CDI ?
@Stateless
class Bean implements IBean {
...
One of the possible reasons you might not be willing to use the interface to inject the EJB could be that you might have many EJBs implementing this interface and your EJB container might be complaining that it's not able to resolve the ambiguity of which particular EJB has to be injected in a given context. If this is the case, you can easily specify the name of the concrete EJB class implementing the common interface using javax.inject.Named
annotation as shown below:
@SessionScoped
class Scoped {
@Named("Bean")
IBean iBean;
}