Results 1 to 2 of 2

Thread: How to handle exception during bean creation

  1. #1
    Join Date
    Jan 2007
    Posts
    7

    Default 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

  2. #2
    Join Date
    Jan 2007
    Posts
    7

    Default

    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
  •