quiero escribir esta pieza de código:¿Inyectando un EJB estático, tonterías?
@Stateless
public class MyEjb
{
@EJB
private static MyOtherEjbWhichIWantStatic myOtherEjb;
}
Tiene sentido para mí, que yo quiero para inyectar un EJB en mi clase, como un elemento estático, por diversas razones.
Java no está muy contenta con que, lamentablemente,
com.sun.enterprise.container.common.spi.util.InjectionException: Illegal use of static field private static MyOtherEjbWhichIWantStatic myOtherEjb on class that only supports instance-based injection
Yo no lo entiendo, ¿por qué no puedo inyectar un EJB estática en otro EJB?
¡Claro, gracias! –