Search code examples
jakarta-eewebsphere-7

Adding new jar files to web application without restarting it


I have a Java EE web application which is running on 2 node cluster of WAS 7.0. This web application has multiple jar files, where in each jar file contains a list of utilities. I might add new jar files in future to this web application. We don't want downtime of this web application when we add new jars to it.

Is it possible to add new jar files to the web application without restarting it? Will the changes take effect instantly?

How do I update an existing jar file which is already loaded by the class loaded? Is it possible to do that without restarting it?

I read about something called Hot deployment in WAS. They have mentioned, Hot Deployment doesn't work on Solaris and HP-UX OSs.

Could you please suggest the best ways to approach this problem?


Solution

  • Is it possible to add new jar files to the web application without restarting it? Will the changes take effect instantly?

    No, it is not possible to add new JARs to the class loader without restarting the application. Even if you create an empty JAR and replace it later, there is no way for the changes to take effect with 0 outage: at least the module will still be restarted.

    How do I update an existing jar file which is already loaded by the class loaded? Is it possible to do that without restarting it?

    You can't, it is not possible.

    I read about something called Hot deployment in WAS. They have mentioned, Hot Deployment doesn't work on Solaris and HP-UX OSs.

    Hot deployment does allow class replacement (but not entire JARs) with 0 down time.

    Other options:

    • Use a routing technology (HTTP proxy, WVE), and ripple-restart the application (i.e., restart the application on one cluster member at a time, and route the intermediate traffic to the other server in the meantime).
    • Use something like JRebel. My understanding is that it's primarily targetted for development environments, but it might also support production.