aspose file tools*
The moose likes Servlets and the fly likes ServletContextListener notified of unrelated wars deploy actions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "ServletContextListener notified of unrelated wars deploy actions" Watch "ServletContextListener notified of unrelated wars deploy actions" New topic
Author

ServletContextListener notified of unrelated wars deploy actions

Jeff Black
Greenhorn

Joined: Aug 02, 2002
Posts: 14
This may be JBoss specific (JB v4.2.1.GA) as the container can implement ServletContextListener as it chooses based on my understanding.

I have two war files each with their own ServletContextListener implementation and each implementing contextInitialized() and contextDestroyed(). I start the container with FIRST.war deployed and see contextInitialized() is notified. I then hotdeploy SECOND.war and his listeners contextInitialized() is notified. However, based on the SECOND.war being deployed to the container, the FIRST.war listener fires its contextDestroyed() and then its contextInitialized() methods.

This seems like strange behavior that the war deploy actions bleed across to unrelated wars. Is my understanding of these methods flawed?

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

Rather than any cross-contaminaton, it sounds more like JBoss or the servlet container has decide to stop and restart the first web app.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Consider Paul's rocket mass heater.
 
subject: ServletContextListener notified of unrelated wars deploy actions