<p>Does anyone know if it is possible to restart a J2EE application (from the application)?  If so, how?</p>

<p>I would like to be able to do it in an app-server-agnostic way, if it is possible.</p>

<p>The application will be run on many different app servers-- basically whatever the client prefers.</p>

<p>If it isn't possible to do this in an app-server-agnostic manner, then it probably isn't really worth doing for my purposes. I can always just display a message informing the user that they will need to restart the app manually.</p>

[{'answer_id': 46576, 'author': 'Hank Gay', 'author_id': 4203, 'author_profile': 'https://Stackoverflow.com/users/4203', 'pm_score': 2, 'selected': False, 'text': '<p>Most application servers provide a JMX interface, so you could invoke that.</p>\n'}, {'answer_id': 46695, 'author': 'shsteimer', 'author_id': 292, 'author_profile': 'https://Stackoverflow.com/users/292', 'pm_score': 4, 'selected': True, 'text': '<p>I would suggest that you\'re unlikely to find an appserver agnostic way.  And while I don\'t pretend to know your requirements, I might question a design that requires the application to restart itself, other than an installer that is deploying a new version. Finally, I would suggest that for any nontrivial purpose "any" appserver will not work.  You should have a list of supported app servers and versions, documented in your release notes, so you can test on all of those and dont have to worry about supporting clients on a non-conforming server/version. From experience, there are always subtle differences between, for example, Apache Tomcat and BEA WebLogic, and these differences are often undocument and hard to determine until you run into them. </p>\n'}, {'answer_id': 46804, 'author': 'jsight', 'author_id': 1432, 'author_profile': 'https://Stackoverflow.com/users/1432', 'pm_score': 2, 'selected': False, 'text': "<p>I'd suggest using servicewrapper to manage the application server, and then use its api methods for requesting a restart of the service.  There would be some configuration involved and its hard to know if this would work in your particuar environment, but thats the only solution that I know of which is even reasonably cross-server compatible.</p>\n"}]
['https://Stackoverflow.com/questions/46568', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4257/']