I want to write this piece of code :
@Stateless
public class MyEjb
{
@EJB
private static MyOtherEjbWhichIWantStatic myOtherEjb;
}
I
From Java EE 5 specification injection of static EJBs is only allowed in application client main classes.
For all classes except application client main classes, the fields or methods must not be static. Because application clients use the same lifecycle as J2SE applications, no instance of the application client main class is created by the application client container. Instead, the static main method is invoked. To support injection for the application client main class, the fields or methods annotated for injection must be static.