D
Dakota Mon
J2EE/JNDI problem
the setup is this. I have an enterprise project that contains an ejb
module and a web module.
In the ejb module I have a session bean named "registerBean".
In the web module I have a servlet named "Control1"
SImply what I want to do is have Control1 do a lookup on registerBean
but this is where the code throws an exception. I have tried 4
different variations on doing the lookup. Each one is listed with the
error it generated in comments.
Object lookup = ic.lookup("java:comp/env/ejb/registerBean");
//javax.naming.NameNotFoundException: registerBean not found
Object lookup = ic.lookup("java:comp/env/registerBean");
//javax.naming.NameNotFoundException: No object bound to name
java:comp/env/registerBean
Object lookup = ic.lookup("ejb/registerBean");
//javax.naming.NameNotFoundException: registerBean not found
Object lookup = ic.lookup("env/registerBean");
//javax.naming.NameNotFoundException
Any ideas or thoughts? I am relatively new to J2EE and JNDI. From
searching on the web I have found numerous entries about a
"JNDI.properties" file. Where is this file and what should I add to it
if anything? Also should I edit one of the XML files and if so with
what?
My environment btw is NetBeans 4.1
Any help appreciated.
the setup is this. I have an enterprise project that contains an ejb
module and a web module.
In the ejb module I have a session bean named "registerBean".
In the web module I have a servlet named "Control1"
SImply what I want to do is have Control1 do a lookup on registerBean
but this is where the code throws an exception. I have tried 4
different variations on doing the lookup. Each one is listed with the
error it generated in comments.
Object lookup = ic.lookup("java:comp/env/ejb/registerBean");
//javax.naming.NameNotFoundException: registerBean not found
Object lookup = ic.lookup("java:comp/env/registerBean");
//javax.naming.NameNotFoundException: No object bound to name
java:comp/env/registerBean
Object lookup = ic.lookup("ejb/registerBean");
//javax.naming.NameNotFoundException: registerBean not found
Object lookup = ic.lookup("env/registerBean");
//javax.naming.NameNotFoundException
Any ideas or thoughts? I am relatively new to J2EE and JNDI. From
searching on the web I have found numerous entries about a
"JNDI.properties" file. Where is this file and what should I add to it
if anything? Also should I edit one of the XML files and if so with
what?
My environment btw is NetBeans 4.1
Any help appreciated.