• Post Reply Bookmark Topic Watch Topic
  • New Topic

Looking Up a Home Object  RSS feed

 
Drew Lane
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just got my first Hello World EJB working. Whew!
I had a few problems, and one thing I still don't understand is the naming of the home objects.
I was following an example but I had to change this:
Object obj = ctx.lookup("HelloHome");
to this:
Object obj = ctx.lookup("Hello");
because I was getting a name not found exception: not bound
Does it use the name of the class that extends javax.ejb.EJBObject?
Thanks,
Drew
 
Attawit Chang.
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it lookup "jndi" name
 
Drew Lane
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did not have any <jndi-name> tag in my deployment descriptor. I am using JBOSS 3.x
Can someone explain further?
Drew
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JNDI name binding is performed in the appserver-specific deployment descriptors. For JBoss, this file is called jboss.xml, which contains stuff like:

What happens when the JNDI name is not declared explicitly depends on the appserver. I guess most appservers default to using the class name of the home or component interface.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!