哪里都允许注入EJB?

Where is it all allowed to inject EJB?

是否可以将 EJB 注入任何 class?谁执行注入 - EJB 容器或包含 EJB 注释的 classes 的容器?

这里摘录自Java EE Tutorial

Dependency injection is the simplest way of obtaining an enterprise bean reference. Clients that run within a Java EE server-managed environment, JavaServer Faces web applications, JAX-RS web services, other enterprise beans, or Java EE application clients, support dependency injection using the javax.ejb.EJB annotation.

Applications that run outside a Java EE server-managed environment, such as Java SE applications, must perform an explicit lookup. JNDI supports a global syntax for identifying Java EE components to simplify this explicit lookup.