This must be happening because all different types of beans are maintained in separate container like Entity beans in different and Session Beans in different and so on. Specifying java:comp/env/ejb means specifying the environment for the component, where it should be looked for, i.e. in ejb. But this environment is already set in case when you try to access a EJB from another EJB, you don't need to specify java:comp/env/ejb again but only the lookup name as mentioned in xml file. As for accessing EJB from Session Bean or from Struts, you have to specify the component environment where to look for the ejb bean, along with its name mentioned in xml file because now you are accessing an entity Bean which lies in another container and not within same container where session Beans are.