During release of EJB 1.1.3 and even on trunk, its observed that the Ejb3IntoMcBeanInjectionTestCase fails frequently. The reason is because of a bug in AbstractEjbReferenceValueMetadata.
AbstractEjbReferenceValueMetadata.getTargetJndiName iterates through all the deployment units but doesn't handle the UnresolvableReferenceException which is thrown as per contract by the EjbReferenceResolver.resolveEjb. As a result, if the first deployment unit in the list of DUs can't resolve the EJB reference, then the AbstractEjbReferenceValueMetadata doesn't move to the next DU.
// Loop through each DeploymentUnit
if (dus != null)
{
for (DeploymentUnit du : dus)
{
// Ensure it's an EJB3 DU (by looking for the processed metadata)
if (du.getAttachment(AttachmentNames.PROCESSED_METADATA, JBossMetaData.class) == null)
// Try to resolve
jndiName = resolver.resolveEjb(du, reference);
// If we've resolved here, we're done
if (jndiName != null)
}
}