There are many ways to assign a global JNDI name to an EJB and likewise many ways
to resolve an ejb-ref to a target EJB. In your first case, the Remote EJB was assigned
a specific global JNDI name but that name was not used to map the remote ejb-ref, so
it could not be resolved.
We have an EJB FAQ entry that explains how remote ejb refs are mapped to their target
EJBs :