Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What is the naming convention of JNDI for EJB 2.1 based component in Glassfish  RSS feed

 
Rajani Gummadi
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I'm using GlassFish V3.0 and working on a very simple stateless session bean example and I my ejb-jar.xml is as follows



In my stand alone client, I tried to lookup for the home as below


I did not setup properties for JNDI server and port as this link, does say "its not required".

I have the interfaces of the package org.ejb.session.interfaces, jar'ed and added to my client class path and also have gf-client.jar in the classpath, again as mentioned in the above link.

My above setup did not work, and returned me javax.naming.NamingException (caused by Caused by: javax.naming.NameNotFoundException: HelloWorld not found).

Then I did asadmin list-jndi-entries from my glassfish installation and found that the JNDI name is actually org.ejb.session.interfaces.HelloWorldHome. So I changed my lookup to use the above reference and it worked.

My question here is, I thought ejb-name in deployment descriptor would be used in JNDI lookup. Did I miss any other file? I knew that, I did not use any container specific configuration file, but I thought GlassFish provides one by default. So is the default setting of GlassFish is to use the entire home object including the package.

Thanks
Rajani
 
Rajani Gummadi
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any advice on this.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!