aspose file tools*
The moose likes Websphere and the fly likes NameNotFOundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "NameNotFOundException" Watch "NameNotFOundException" New topic
Author

NameNotFOundException

debraj gupta
Greenhorn

Joined: Jul 31, 2001
Posts: 2
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);
lavanya subramanian
Ranch Hand

Joined: Nov 03, 2000
Posts: 52
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

Joined: Jul 31, 2001
Posts: 2
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

Joined: Nov 03, 2000
Posts: 52
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NameNotFOundException