Which two are programming restrictions in the EJB specification? (Choose two.)
A.
An enterprise bean must NOT attempt to load a native library.
B.
An enterprise bean must NOT declare static fields as final.
C.
An enterprise bean must NOT attempt to create a new security manager.
D.
An enterprise bean must NOT propagate a RuntimeException to the container.
E.
An enterprise bean must NOT attempt to obtain a javax.naming.InitialContext.
Explanation:
The following is a list of Java features that you should avoid, hence restricting their
use in your EJB components’ implementation code:
(A)Loading native libraries.
(C)Attempting to create or obtain a class loader, set or create a new security manager(C), stop the
JVM, change the input, output, and error streams. That restriction enforces security and maintains
the EJB container’s ability to manage the runtime environment.
(not B)Using static, nonfinal fields. Declaring all static fields in the EJB component as final is
recommended. That ensures consistent runtime semantics so that EJB containers have the
flexibility to distribute instances across multiple JVMs.
Reference:Programming restrictions on EJB
A, C