Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JNDI error while LocalHome stub ref lookup

 
Pawanpreet Singh
Ranch Hand
Posts: 264
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

I have deployed a Stateless session bean using Local interfaces. When i lookup the Local home stub ref by JNDI using below given code,


Context ic = new InitialContext();

elloHomeLocal localHome = (HelloHomeLocal) ic.lookup("HelloEmployee");

I get following exception. I have deployed EJB with JNDI name:HelloEmployee

javax.naming.NameNotFoundException: HelloEmployee not found


Please help me to solve this.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pawan,

You can use the jmx-console to view the JNDI tree contents as mentioned here. Search for your bean and check what's the jndi-name of your bean and then use that jndi-name for doing the lookup.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic