• 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

NameNotFOundException

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am getting a NameNotFoundException when I do a lookUp.
I am using a WAS4.0 for deployment.
Following is the piece of code that I have written for my client which is an external resource ie non EJB:
Properties p = new Properties();
javax.naming.InitialContext jndiContext = new javax.naming.InitialContext();
Object obj = jndiContext.lookup("ReqDispSession");
--> Error occurs here.
System.out.println("Hello1");
ReqDispatchSessionBeanHome ReqDispSessionBeanHome = (ReqDispatchSessionBeanHome)obj;

Also I got the following error codes during deployment :
APPW0007E & APPW0004E....This came up in the administrative console when I tried to install my ear file. Could somebody tell me what could the problem be?
Thanks
Deba
//javax.rmi.PortableRemoteObject.narrow(obj,ReqDispatchSessionBeanHome.class);
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi debraj,
even i got this error:Name not found.
Properties p = new Properties();
p.put(javax.naming.Context.PROVIDER_URL,"iiop://localhost:900/");
p.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
javax.naming.InitialContext ic = new javax.naming.InitialContext(p);

try this and let me know if it works.
bye,
lavi
 
debraj gupta
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi lavi,
The Initial Context Fctory that u have mentioned is for WAS3.5 and not for 4.0. I did apply the Initial COntext Factory value for WAS4.0, and even then it did not work.
Is there any other alternative??
Thanks & bye
Deba
 
lavanya subramanian
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi debraj,
i asked one of my friend who is working with WAS4.0,even he says u cannot directly use this initialcontext to get the jndi name
try this one
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"whateverinitialcontextfactory u use");
Context ctx = new InitialContext(p);
this should help and let me know what happens
reply
    Bookmark Topic Watch Topic
  • New Topic