-
Mar 12th, 2007, 10:21 AM
#1
How to handle exception during bean creation
I'm attempting to connect to an exported RMI object on another server from within an application context. If that RMI object is not available I get an RMI exception which causes issues during application startup.
How are these exceptions supposed to be handled within Spring?
Thanks
Jim
-
Mar 12th, 2007, 01:28 PM
#2
I'll answer my own question:
For the RMI object being obtained through the RmiProxyFactoryBean turn off "lookupStubOnStartup" and turn on "refreshStubOnConnectFailure".
The resulting behavior will allow the RemoteAccessException to be caught in your POJO and dealt with appropriately at that level. In my case I simply caught the exception and start a timer that attempted to reconnect.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules