glassfish

GlassFish application reload with asadmin


Is it possible to reload a web application in GlassFish 4 using the asadmin command line tool? The GlassFish web console has a "reload" button you can push that does this. Is there an equivalent for asadmin? I know there is dynamic reloading where you change a file and it reloads, but I just deployed a war file and now want to reload it so it re-connects to an external socket server (no code has changed and since it was a war I don't think there is a file to touch - further I've disabled dynamic reloading on production server). If I use use "redeploy" that works too, but you must specify a war file, which is annoying as that means I've got to leave one in a fixed spot and make sure it is in sync with whatever is actually deployed.


Solution

  • It seems like asadmin doesn't have a "reload" subcommand (all subcommands listed on this page: http://docs.oracle.com/cd/E18930_01/html/821-2417/gihzw.html).

    Maybe using the command "asadmin disable {applicationName}" followed by "asadmin enable {applicationName}" will have the same effect, that is probably what glassfish does when you hit reload button.