Announcement Announcement Module
No announcement yet.
Reloading Spring beans - without container restart Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reloading Spring beans - without container restart

    I have some spring beans which are loaded at startup, now I need to reload the spring beans without restarting the container, so that it can have latest values in the beans.

    Are there any callback or listener available to do this ? or do we need to use any JMX for this ?

  • #2
    Reloading individual beans within an existing application context is problematic, because references that other beans hold to objects from beans which have been reloaded will be left in an inconsistent state.

    Have you considered using a dynamic module framework? You can use one of the SpringSource OSGi-based frameworks, or outside of OSGi you can use Impala. These allow you to reload parts of your application (both bean definitions as well as modifications to classes and resources) without restarting your container.

    Phil Zoio
    Impala - simple dynamic modules for Spring