Stateless EJB implements interface injection failed

后端 未结 2 1045
情深已故
情深已故 2021-01-16 06:29

Wildfly 8.2.0

I have a Stateless EJB and an interface.

@Local
@Stateless
public class Bean implements IBean{
...
}

@Local
public interf         


        
2条回答
  •  太阳男子
    2021-01-16 07:14

    When you want to inject a bean whether by EJB (using @EJB) or CDI (using @Inject) container you declare a variable with interface type. Concrete implementation of declared interface is found by a container during application deployment. In your example the problem is not with annotations but with a declared type being injected (Bean instead of IBean).

提交回复
热议问题