In general, which config file to modify to bind a Bean's JNDI name with the Bean? Say, if I call _context.lookup("java:comp/env/ejb/MySessionBean");Where do I specify the JNDI name "ejb/MySessionBean"? Thanks.
1)If you want to bind an EJB to JNDI name in a weblogic server , you need to make an entry in the weblogic-ejb-jar.xml file <jndi-name>SomeName</jndi-name>.
2)The way in which you are looking for the EJB(as mentioned in your post),it seems that you are trying to use the EJB in some other EJB or from webapplication.If this is the case then you need to make an entry for the EJB you are looking up using code("java:comp/env/ejb/MySessionBean") as follows
For E.g: You are trying to use code mentioned by you in SessionBean1 , then this entry will go in the ejb-jar.xml of SessionBean1. This way is called as Environmental lookup of an EJB.