According to the
EJB specification 2.0, a MDB may only provide a run-as element within its security-identity element, use-caller-identity being forbidden for an MDB. The specification further states that "The run-as identity establishes the identity the enterprise bean will use when it makes calls."
What happens if you specify use-caller-identity in the security-identity element is container specific in my opinion. Logically, the container should prevent the MDB from being deployed if such a case happens. But, I firmly doubt that an exception would be raised at runtime as this would imply that the deployment was successful even though the deployment descriptor did not satisfy the specification which is a must for all EJB container implementors.
[ April 02, 2004: Message edited by: Valentin Crettaz ]