WebSphere Portal Server - remote EJB call: Exception: NameNotFound & Root Exception:

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > December 2007 > remote EJB call: Exception: NameNotFound & Root Exception:





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author remote EJB call: Exception: NameNotFound & Root Exception:
harish.g.nair@accenture.com

2007-12-18, 7:36 am

I am accessing a simple EJB named DefaultSession from the init method of portlet. The code is written below. It provides a provider url when InitialContext instance is created, which is then used to lookup the ejb. <br />
<p />
But it fails with exception: javax.naming.NameNotFoundException: Context: serverip-cell/nodes/Node01/servers/server1, name: ejbs/DefaultSession: First component in name ejbs/DefaultSession not found. Root exception is org.omg.CosNaming.NamingContextPackag
e.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0. The exception is also detailed below.<br />
<br />
The environment is:<br />
<br />
Client portal web running on -- WebSphere Portal Server 6.0.1.1 installed on top of WebSphere Process Server 6.0.2.3<br />
<br />
The EJB deployed on -- WebSphere Process Server 6.0.1.17 (wid- monitor test server)<br />
<br />
________________________________________
________________________________________
________________________________<br />
<br />
Code sample:<br />
<p />
<br />
public void init() throws PortletException{<br />
<br />
super.init();<br />
<br />
try{<br />
<br />
System.out.println(" access Bean");<br />
<p />
<p />
<br />
System.out.println("init()- Local home created");<br />
<br />
//Obtain the default initial JNDI context<br />
<br />
Hashtable env = new Hashtable();<br />
<p />
<br />
env.put(Context.PROVIDER_URL, "iiop://serverip:2810");<br />
<p />
<br />
InitialContext initialContext = new InitialContext(env);<br />
<br />
System.out.println("got initialContext");<br />
<p />
<p />
//Lookup the home interface of the bean<br />
<br />
Object result = initialContext.lookup("ejbs/DefaultSession");<br />
<br />
System.out.println("got lookup: "+result);<br />
<p />
<br />
//Convert the lookup result to the proper type<br />
<br />
DefaultSessionHome sessionHome = DefaultSessionHome)javax.rmi.PortableRemoteObject.narrow(result,DefaultSessionHome.class);<br />
<br />
System.out.println("got htmHome"+sessionHome);<br />
<p />
<br />
//Access the interface of the session bean<br />
<br />
ds = sessionHome.create();<br />
<br />
System.out.println("Bean home created");<br />
<p />
<br />
}catch(Exception e){<br />
<br />
System.out.println("Exception message: "+e.getMessage());<br />
<br />
System.out.println("exception: "+e);<br />
<br />
}<br />
<p />
<br />
}<br />
<br />
________________________________________
________________________________________
____<br />
<p />
<br />
System.out:<br />
<p />
<br />
12/17/07 16:49:55:581 IST 0000008b SystemOut O access Bean<br />
<p />
<br />
12/17/07 16:49:55:581 IST 0000008b SystemOut O init()- Local home created<br />
<p />
<br />
12/17/07 16:49:55:671 IST 0000008b SystemOut O got initialContext<br />
<p />
<br />
12/17/07 16:49:55:791 IST 0000008b SystemOut O Exception message: Context: serverip-cell/nodes/Node01/servers/server1, name: ejbs/DefaultSession: First component in name ejbs/DefaultSession not found.<br />
<p />
<br />
12/17/07 16:49:55:791 IST 0000008b SystemOut O exception: javax.naming.NameNotFoundException: Context: serverip-cell/nodes/Node01/servers/server1, name: ejbs/DefaultSession: First component in name ejbs/DefaultSession not found. Root exception is org.omg.
CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0<br />
<p />
<br />
________________________________________
________________________________________
____<br />
<p />
No other detail is coming forth... advance thanks for help.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com