• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JNDI Name in EJB3

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It should be someting like mappedName#

a proper google search under Oracle weblogic forums , will find you a solution .
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic