What is the proper way to redeploy a new version of a running app in glassfish? I have a WAR running, and I've made changes. I thought doing an undeploy + deploy might be the right thing, but glassfish (v3) often crashes when I undeploy.
What' the proper way to redeploy a running app in glassfish?
There are a number of ways to redeploy a web application onto GlassFish v3.
The method I would recommend is 'asadmin redeploy --name foo --properties keepSessions=true foo.war' (or use directory deployment for the web app...)
You can look at the man page for the deploy subcommand of asadmin to learn more about the details.
I hardly ever undeploy then deploy.... it takes too long.
I hardly ever create a dot-war file.... I usually do directory deployment, which eliminates the time that would get used up creating and then exploding the war file.
By using directory deployment I can also apply tweaks to jsp files and test them without a rebuild/redeploy step.
I like to use the keepSessions property while I am doing development. I don't know whether this property would be useful in a production situation.
The method that you described probably should not crash the server... Please file an issue at https://glassfish.dev.java.net/servlets/ProjectIssues so folks on the team can track down what the problem might be.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With