Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

JNDI lookup failure in WAS 4.0

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anybody help me !
I am having problems while looking for my JNDI which is registered properly in WAS 4.0. I am facing the following error.
javax.naming.NameNotFoundException: Pbs
at com.ibm.ejs.ns.jndi.CNContextImpl.doLookup(CNContextImpl.java:1435)
at com.ibm.ejs.ns.jndi.CNContextImpl.lookup(CNContextImpl.java:1115)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at PbsClient.main(PbsClient.java:11)

With the client code PbsClient.java
in the following lines itself
import java.util.*;
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
public class PbsClient {
public static void main(String[] args) {
try {
// Context initial = new InitialContext();
Context initial = getContextInfo();
Object objRef = initial.lookup("Pbs");
System.out.println(objRef==null);
}catch (Exception ex) {
System.err.println("Caught an exception.");
ex.printStackTrace();
}
}

I am sure that the client lookup is perfect since the sample EJB Jndi lookup doesn't give any error. I am using AAT to create my .ear file which doesn't throw any error. While deploying in admin console also no probs. In look up i am facing problems. Can any one help
 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should ensure that the deployment descriptors have the corresponding JNDI name. When you are AAT make sure the EJB you are trying to reference has that name in there.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check your references in AAT for pbs
 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
the problem might be in the reference names,y dont u do onething,u better use this utility called dumpNameSpace in the was4.0,run this utility it wud tell u all the references and bindings u have given,then u can come to a conclusion of where wud have gone wrong.
I dont know whether this wud give u the solution.
but y not make a try.
Good luck.
Inform me if u get thro this.
If u dont know how to use this,
type dumpnamespace help,in the was root/bin directory,it wud help u out
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic