• Post Reply Bookmark Topic Watch Topic
  • New Topic

Naming Exception

 
Latha Kota
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created my first session bean, and a client code to get the Home object. But when I am running I am getting an Exception saying:

java.lang.RuntimeException: ItenaryDelegate.getRemote caught Naming Exception.

I dont know what it is, so anyone can tell how to resolve it, it would be of great help. My client code is pasted below:

private ItenaryRemote getRemote() {
//Get ItenaryHome object from JNDI lookup
try {
if (this.itenary == null) {
ItenaryHome home = (ItenaryHome) EJBHomeFactory.getFactory().lookupRemoteHome(
"com.jbhunt.apps.driverplace.gui.scheduling.ItenaryRemote", ItenaryHome.class);
//Create Remote object from Home object and set the remote object to
//this class remote object
this.itenary = home.create();
}
}
catch (NamingException e) {
log.error("ItenaryDelegate.getRemote caught Naming Exception" + e);
throw new RuntimeException("ItenaryDelegate.getRemote caught Naming Exception",e);
}
catch (RemoteException e) {
log.error("ItenaryDelegate.getRemote caught RemoteException" + e);
throw new RuntimeException("ItenaryDelegate.getRemote caught RemoteException",e);
}
catch (CreateException e) {
log.error("ItenaryDelegate.getRemote caught CreateException" + e);
throw new RuntimeException("ItenaryDelegate.getRemote caught CreateException",e);
}
catch (Exception e) {
log.error("ItenaryDelegate.getRemote caught Exception" + e);
throw new RuntimeException("ItenaryDelegate.getRemote caught Exception",e);
}

return this.itenary;
}
Thanks,
Latha
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Latha,

I don't know how your EJBHomeFactory is implemented, but JNDI lookups work on registered names and not the fully qualified class name( unless that is your registered name). I see that in your code above, you are trying to lookup "com.jbhunt.apps.driverplace.gui.scheduling.ItenaryRemote" but what is the registered name for this class? Look in the EJB Deployment Descriptor and try using that instead.

HTH
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!