Glassfish taking 20s to do hot deployment, is that

2019-04-08 13:09发布

问题:

I'm working in a JSF project with Eclipse and Glassfish 3.1.2. Every time I did a minor change and save it, Glassfish do the hot deployment, but is taking too much time to do that, about 20s, at least.

Can I do something do deacrease this time ? Is horrible develop something where you have to wait all time time everytime I change something.

UPDATE This is how my project settings.

Just open the folder below, this surprise me, is this so many .jar files, is this correct ?

And this one:

My Glassfish configuration :

Any idea ?

回答1:

There are several ways to deploy a GlassFish application. To speed up development/debuging we need a way to instantly deploy web applications. One of the ways is to use hot deployment feature, another lesser known feature is ‘directory deployment’. You simply point GlassFish to your development directory and let it pick up and deploy application from there. No packaging and re-deoploying hassles. The catch is whenever you want to re-deploy your application you just need to touch a file called .reload which should be present in your web folder. Following is the command and directory structure you can use.

–|myproj
–|–|src
–|–|web
–|–|–|WEB-INF
–|–|–|–lib
–|–|–|–classes
–|–|–|–web.xml
–|–|.reload

GLASS_FISH_HOME/bin/asadmin deploydir full_path_to_you_web_folder