Announcement Announcement Module
No announcement yet.
Spring bean - How to get back the bean after redeploying the application Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring bean - How to get back the bean after redeploying the application


    My application has enormous number of spring bean. I want the state of the bean to persists after redeploying the application also. Means after building the new WAR and adding that to tomcat. Currently all the beans are created newly when i redeploy the application and eventually results in java.lang.outOfMemory error.

    Please provide me some suggestion on this.
    thanks in advance.


  • #2
    I would look into why you are getting the OOM errors, try looking into the "destroy-method" attribute as part of your bean definition, or implement the DisposableBean interface for those classes that already use spring.


    • #3
      Hi cwilkes,

      Thanks for your reply.
      Actually our application is spring based and other framework we use with in our application is Quartz, Velocity, Acegi, EHCache like the list grows.

      Even i implement a destroy method or not, The introspector listener which is called by the spring while undeploying flushes the introspector cache which has all the hardreferences.

      But since we use the Frame work such as Quattz and all which do not implement the introspector listener still it is holded in the cache which eventually throws the OOM error.

      Is there any way to overcome this?

      Note: we have never used Logger.shutdown() in our application. (using log4j)

      We do not know how much the above information helps you but please ask for more context.

      You can check this link to know about introspector,

      we are pleased to give you more information about the application if necessary.

      Harish Srinivasan.


      • #4
        Automatic redeployment on tomcat in combination with some frameworks (cglib, hibernate) and the default sun jdk are a combination for OutOfMemory errors. We only use hot deployment/auto redeployment in development, and after a redeployment or 10 we have to shutdown and restart tomcat, for production we don't even (want to) rely on the auto redeploy on tomcat. (Depending on it for production sites is a alse a huge risk IMHO).

        A few months ago I switch mu default sun JDK to the one from bea, jrockit they have a complet different memory model and since then our OOM in development went away.