This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General 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: 64827
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