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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply 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: 56179
    
  13

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


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: ServletContextListener notified of unrelated wars deploy actions
 
Similar Threads
Listener class not mapping Hibernate xmls
creatin plugin
Relative path of an XML file?
How to stop Servlet when reloading Application
Tutorials on Listeners