3 Replies Latest reply on Jul 26, 2012 11:52 AM by ctomc

    Accessing datasources when ServletContextListener.contextDestroyed() called (JBoss AS 7)

    shaun.kalley

      I use a ServletContextListener to start and stop background services that my webapp uses, for example, to tabulate and persist user statistics to the database.  So when I shut down the webapp I need to make database calls to persist any outstanding data from those services.  However, when contextDestroyed() is called, I get the following error: "javax.resource.ResourceException: IJ000451: The connection manager is shutdown".

       

      Is there a way to keep the datasources open until after the servlet context has finished shutting down?

       

      Any help would be greatly appreciated.

       

      Thanks,

      Shaun