Use the JNDIView http://wiki.jboss.org/wiki/DisplayTheJNDITreeWithTheJMXConsole to check what's the jndi name for your bean1 in EAR1. Then try using that as the mapped name for injecting this bean in bean2 in EAR2. You can post the JNDI tree here, if you need help in understanding the output.
P.S: A new forum for JBoss AS5 has been created at http://www.jboss.com/index.html?module=bb&op=viewforum&f=287 for JBoss AS5 specific questions. Let's use that forum for any new questions on JBoss 5.
public class KundenverwaltungBean implements Kundenverwaltung
Instead of mappedName, use @RemoteBinding for specifying JNDI name for the remote interface of the bean and @LocalBinding for the local interface:
import org.jboss.ejb3.annotation.LocalBinding; import org.jboss.ejb3.annotation.RemoteBinding; @Stateless @RemoteBinding (jndiBinding = "mapped/hska/Kundenverwaltung") public class KundenverwaltungBean implements Kundenverwaltung
And in which jar do I find the org.jboss.ejb3.annotation.LocalBinding?
I only found it in the embedded JBoss, but this is definately not what IÂ´d like to include in my jar-dependencies.
And what is the reason, that there are two annotations LocalBinding? There is also one in org.jboss.annotation.ejb.LocalBinding that can be found in the jar "jboss-annotation-ejb-4.2.3.GA"