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.
-
Where to specify Session Bean JNDI name (2 messages)
- Posted by: Jen R
- Posted on: June 22 2004 21:43 EDT
Threaded Messages (2)
- Where to specify Session Bean JNDI name by Amit L on June 23 2004 07:23 EDT
- Accessing EJB from web app by Jen R on June 23 2004 14:17 EDT
-
Where to specify Session Bean JNDI name[ Go to top ]
- Posted by: Amit L
- Posted on: June 23 2004 07:23 EDT
- in response to Jen R
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.
Hi
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
<ejb-ref>
<ejb-ref-name>ejb/MySessionBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.MySessionHome</home>
<remote>com.MySession</remote>
</ejb-ref>
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.
Thanks
Amit -
Accessing EJB from web app[ Go to top ]
- Posted by: Jen R
- Posted on: June 23 2004 14:17 EDT
- in response to Amit L
I'm accessing the Session bean from a web application and I'm using WebLogic. So, should I specify the <ejb-ref> entry in web application config file, say web.xml? Thanks.