• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Naming Exception

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Note to self: don't get into a fist fight with a cactus. Command this tiny ad to do it:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic