This content has been marked as final.
Show 1 reply
-
1. Re: jndi lookup/referencing question
jamesstrachan Jun 15, 2004 6:44 AM (in response to nano_uhe)Nano,
I have just had to deal with a very similar problem in another application server.
I would suspect that your home reference, which you get as you initialise the servlet, contains internal information which becomes out of date when your colleague does a hot deploy.
This will then lead to an error when you try to use the home interface to get the remote interface.
A suggested cure is to check for exceptions when you access the remote, and to close and reopen the home interface if an error occurs. It would be best to put this in a loop with a retry limit so that it will fail after two or three times if other errors occur.
See sample code below :-while ( remoteFound == false && retryAttempts < retriesLimit ) { try { // Test for existing home connection. Retry if life expired. if ( home == null ) { getHome(); } remote = home.create(); remoteFound = true; } catch ( Exception e ) { fatalException = e; home = null; retryAttempts++; } }
The variable fatalException will be used to report other errors if the remote could nott be found.
James