This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JNDI Name in EJB3

 
Somesh Rathi
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
Somesh
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should be someting like mappedName#

a proper google search under Oracle weblogic forums , will find you a solution .
 
Manuel Alberto Quero
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

mappedName\#interfacepackage.CalculatorRemote

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,

Manuel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic