aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Look up fails twice then works fine??! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Look up fails twice then works fine??!" Watch "Look up fails twice then works fine??!" New topic
Author

Look up fails twice then works fine??!

Ranjith R
Greenhorn

Joined: Sep 18, 2001
Posts: 22
Box: DELL with intel P2 Celeron, 128MB RAM,8GB HDD
App.server: WLS 6.1 eval
I am using a Home Look up factory to cache and return my home interfaces. Now, the problem is the look up fails for the first time. Saying "JNDI name unresolved" or displaying
and ASSERTION[****Must initialize before use****] error.Then If I run the client again, the look up gets thru and everything works fine.what could be the reason behinde this strage problem??
-please help-
If the code provides any help, it is the following.
public EJBHome getEJBHome(String serviceName, Class serviceClass)
throws ServiceLocatorException {
log("getEJBhome with "+ serviceName);
EJBHome home = (EJBHome) homeCache.get(serviceName);
if ( home == null ) {
try{
log("getEJBHome new Required");
Object homeref = initialCtx.lookup (serviceName);
home = (EJBHome) javax.rmi.PortableRemoteObject.narrow ( homeref, serviceClass );
homeCache.put(serviceName,home);
log("getEJBHome returning "+serviceName);
} catch (NamingException ex ) {
throw new ServiceLocatorException("Failed to look up the EJBHome for "+ serviceName + " object ",ex);
} catch (Exception ex) {
throw new ServiceLocatorException("Failed to return the EJBHome for "+ serviceName + " object ",ex);
}
}
return home;
}

------------------
Take care
r@njith


Take care<BR>r@njith
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Look up fails twice then works fine??!
 
Similar Threads
ServiceLocator - issue when shared between two web app.
ejbFind() in Entity Bean
Service Locator
Interesting session exception
ClassCast Exception on EJB remote object lookup