Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

J2EE/JNDI problem

Thread view: 
Dakota Mon - 21 Feb 2006 04:10 GMT
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.
xabo - 21 Feb 2006 05:52 GMT
you might not have the correct entry for the resource ejb/registerBean
in web.xml
refer to the deployment-descriptor guidelines for the app-server you
are using.
for tomcat refer to
http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html
Paulus de Boska - 21 Feb 2006 11:25 GMT
jndi.properties are taken care of by the app-server, you only need
those in a standalone client fe.
Every app-server has a JNDI viewer, there you can determine the exact
name you have to use.
For JBoss fe :
http://localhost:8080/jmx-console/
then the jndiview service under JBoss
then invoke list

---
Paul Hamaker, SEMM
http://javalessons.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.