Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Glassfish war lifecycle question

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?

like image 392
Robot Avatar asked Mar 23 '10 01:03

Robot


1 Answers

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.

like image 135
vkraemer Avatar answered Oct 18 '22 00:10

vkraemer