File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes JNDI Name in EJB3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JNDI Name in EJB3" Watch "JNDI Name in EJB3" New topic

JNDI Name in EJB3

Somesh Rathi
Ranch Hand

Joined: Apr 27, 2006
Posts: 36
My query is how and where to specify the JNDI Name while creating EJB3 ? I know in EJB3 , we dont have necessarily ejb-jar.xml.

I tried following:-
Defining global jndi name using mappedName attribute in @Stateless annonation. However when i'm running Test client ,I'm getting :-
javax.naming.NameNotFoundException: Unable to resolve 'CalculatorService'. exception

I'm created and deployed Stateless Session EJB3.0 Bean
Bean class is as follows

Many thanks in advance,
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

It should be someting like mappedName#

a proper google search under Oracle weblogic forums , will find you a solution .

Save India From Corruption - Anna Hazare.
Manuel Alberto Quero
Ranch Hand

Joined: Jul 17, 2009
Posts: 31
Hi Somesh Rathi,

In EJB 3.0, JNDI names depend on the Application Server.
Weblogic builds global JNDI names for EJB remote references as follows:


interfacepackage: the package of CalculatorRemote

You can check this out by accessing Weblogic Admin Console (search for something like: Environment->Server->View JNDI Tree)

The name of EJB local references is defined in deployment descriptors (web.xml and ejb-jar.xml).

Anyway, if you do not want to use lookup explicitly, you could use the @EJB annotation.

Hope this helps,

I agree. Here's the link:
subject: JNDI Name in EJB3
It's not a secret anymore!