• 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
Sheriff
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.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!