Question

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

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

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

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.

Was it helpful?

Solution

I would suggest that your unlikely to find an appserver agnostic way. And while I don't pretend to know your reqs, 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.

OTHER TIPS

Most application servers provide a JMX interface, so you could invoke that.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top