by cluster aware, i mean if i get a EJB Home reference from cache (using the Service Locator component) and the server having the object, is down so here i may get some exception.. so how i should make sure in my program so that i dont get this exception.
Your service locator could hand out dynamic proxies, which intercept every call to the EJBHome, catch the first exception, retry after looking up a new reference from JNDI, and if it still throws an exception, rethrow it to the client.
Another possible approach has been presented in a JavaWorld article on
Verified Service Locator Pradeep, I think most containers don't have the functionality to inform existing stubs about new/dead servers but it wouldn't be that difficult to implement, I guess.