• 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Bear Bibeault
  • paul wheaton
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Mikalai Zaikin
  • Piet Souris
Bartenders:

Exception while doing lookup

 
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello sir, madam, friends

I am getting NameNotFoundException when I do a look up.
Context c = new InitialContext();
Object o = c.lookup("Local"); // 2

I get the exception at line 2. I am wondering why I get this exception when I use EJBLocalHome and EJBLocalObject i.e while dealing with local clients. I dont get this exception when I using EJBObject and EJBHome classes i.e with remote clients. As far my understanding goes the lookup process is the same whether we are dealing with local or remote clients.I am using Reference Implementation server provided by Sun.
I am trying to run different applications. One application is where I am using remote clients ad other application is where I am using local clients. When I run my remote client I dont see any NamingException. But when I run my local client then I get NameNotFoundException.Both the applications are nowhere related to each other.I verfied the JNDI name that I provided while deployment to the one the client is doing lookup on. Both the names are matching.

Can anyone please help me out where I am going wrong ?

Waiting for your replies

~Rohit.
[ March 19, 2006: Message edited by: Rohit Bhagwat ]
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Local Interfaces are only available by an EJB in the same application server and due to class loading issues mostly only to EJBs in the same EJB/JAR file. Local does not mean, whatsoever, that you can look them up by a Java application on the same computer.

-Andy
 
Rohit Bhagwat
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all

I have posted my problem at the following link. Actually in that link I mentioned other details as well so dont want to repeat the same lines here. Can you please help me. The problem is mentioned in the following link
https://coderanch.com/t/161705/java-EJB-SCBCD/certification/Exception-while-doing-lookup

Regards
Rohit.
[ March 27, 2006: Message edited by: Rohit Bhagwat ]
 
Rohit Bhagwat
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello friends

I forgot to mention the ejb-ref parameter while using local interface thats why my jndi name for local client was not getting registered using Sun' Reference Implementation server

I just made a note that
a. I made entry for ejb-local-ref parameter using RI's deploytool.
b. Ensured that my client and my EJB are working in the same JVM.

By taking care of the above points, I am able to invoke methods on my ejb that is implementing local interface.

Thanks and Regards
Rohit.
[ April 02, 2006: Message edited by: Rohit Bhagwat ]
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Freind

The parameter you have passed in lookup (means jndi name) same jndi should be in Deployment Descriptor which can be created through ant command or writting that deployment descriptor.After all these setting your application will work successfully (not display exception report)

With Best Regards
Rajesh Pandey
mail: rajesh-pandey@hotmail.com
India Delhi
 
A wop bop a lu bop a womp bam boom! Tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic