Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletContextListener notified of unrelated wars deploy actions

 
Jeff Black
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64626
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rather than any cross-contaminaton, it sounds more like JBoss or the servlet container has decide to stop and restart the first web app.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic