1.通过JNDI查找方式来查找其他的bean
InitialContext ctx = new InitialContext();
HelloWorld helloworld = (HelloWorld) ctx
.lookup("实现类的简单名称/remote");
2.通过注解@EJB
例如
@EJB Other other;//现在就可以使用Other里面的公共方法了,条件是Other必须是一个EJB对像
@Resource TimeService TimeService;//注入其他的对象,比如EJB3中TimeService类,@Resource类路径是javax.anontation.Resource;