GlassFish Auto Deployment and Hot Deployment

Amit

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

If you are using Eclipse or NetBeans make sure that they put the class files in web-inf/class folder after compiling.

about the author

Amit

  1. Fangzx

    November 18, 2007

    Thanks for this greate tip! I am tired of Eclipse’s auto redeploying, and I lookup this tip for two days!

    In my practice, dir structure should like this:
    –|myproj
    –|–web
    –|– …
    –|–WEB-INF
    –|–|–lib
    –|–|–classes
    –|–|–web.xml
    –|–|–sun-web.xml
    –.reload

    note: in sun-web.xml, you can define custom context name like this(otherwise the dir name become context name):

  2. Fangzx

    November 18, 2007

    content of sun-web.xml:

    /seamsample2

  3. Mellon

    March 10, 2008

    In windows, how to “touch” a file?
    How to make NetBeans touch the file automaticly after some .java files are changed?

  4. Rocio

    February 25, 2010

    Thank you very much.

    I have also specified the parameter contextroot to define the name to call the web application.

  5. Kyle Bailey

    May 19, 2010

    we have an Automotive shop at home because my dad and i loves automobiles. -:”

  6. Roberto

    March 13, 2011

    Touch a file in windows by using cmd.exe
    In Eclipse; follow these steps:

    Right-click on the project; choose properties
    Click on builders
    Click New
    Enter “Touch reload”
    Location: C:\Windows\System32\cmd.exe
    Working Directory: ${project_loc}
    Arguments: /C “echo hello > ${project_loc}\.reload”
    Click on build options
    Check “During auto Builds” THIS IS VERY IMPORTANT THIS WILL MAKE THE AUTORELOAD FILE GET MODIFIED ON EVERY JAVA FILE CHANGE

  7. supplements

    August 19, 2011

    Is there anyway I could get a copy of this wp topic? Ive been searching on wp.org and cant truly come across something I like but this will be perfect for me. Thanks in advance!

  8. you get your ex back

    August 23, 2011

    You have observed very interesting details! ps decent website.

  9. xixihaha567

    September 10, 2011

    Quite a beautiful web site. I built mine and i was looking for some style ideas and your website gave me some. Did you develop the web site alone?

  10. anioly

    September 19, 2011

    Keep writing. Your work is excellent.

  11. ogloszenia erotyczne

    September 21, 2011

    The test is great. Not only well-written but also educational and inspirational.

  12. BG mail

    October 8, 2011

    Aw, this was a really nice post. In thought I want to put in writing like this additionally – taking time and precise effort to make an excellent article… however what can I say… I procrastinate alot and certainly not seem to get something done.

  13. Flor Littell

    October 16, 2011

    Answer: because you see the dark blue one and go “wow” then the white one pops up and you go: “WOAAAAAHHH I WANT ONE” and there you go, Mazda won again!

  14. Greeting Cards

    October 22, 2011

    Hello I am so excited I found your webpage, I really found you by error, while I was researching on Yahoo for something else, Anyhow I am here now and would just like to say many thanks for a marvelous post and a all round enjoyable blog (I also love the theme/design), I don’t have time to read it all at the minute but I have book-marked it and also added your RSS feeds, so when I have time I will be back to read more, Please do keep up the great job.

  15. stationery

    October 23, 2011

    Wow! This could be one particular of the most beneficial blogs We have ever arrive across on this subject. Basically Magnificent. I’m also a specialist in this topic therefore I can understand your effort.

  16. Dieting Program

    October 23, 2011

    Hello I want to write a new comment on this page regarding you to let you know just how much i Enjoyed this read. I have to run off to work but wished to leave you a brief remark. I saved you So definitely will be returning after work to read more of yer quality posts. Keep up the quality work.

  17. flyer distribution

    November 9, 2011

    Very interesting subject, thank you for posting.

  18. modeblog berlin

    November 13, 2011

    There is obviously a bunch to identify about this. I feel you made some nice points in features also.

  19. deccccorative24

    November 14, 2011

    Discourage litigation. Persuade your neighbors to compromise whenever you can. As a peacemaker the lawyer has superior opportunity of being a good man. There will still be business enough.

  20. hotels kosova

    November 28, 2011

    Simply to follow up on the up-date of this subject matter on your website and would wish to let you know how much I valued the time you took to create this handy post. In the post, you actually spoke regarding how to actually handle this concern with all ease. It would be my pleasure to get together some more suggestions from your site and come as much as offer some others what I have benefited from you. Many thanks for your usual wonderful effort.

  21. arcopedico

    November 30, 2011

    Thank you for sharing superb informations. Your web site is very cool. I’m impressed by the details that you have on this site. It reveals how nicely you understand this subject. Bookmarked this website page, will come back for more articles. You, my friend, ROCK! I found simply the information I already searched everywhere and simply couldn’t come across. What a great website.

  22. Online Calculator

    December 9, 2011

    I have been exploring for a little bit for any high-quality articles or weblog posts on this kind of house . Exploring in Yahoo I ultimately stumbled upon this site. Reading this information So i’m satisfied to convey that I’ve a very excellent uncanny feeling I found out exactly what I needed. I so much no doubt will make certain to do not put out of your mind this web site and give it a glance regularly.

  23. postal bags

    December 10, 2011

    You can certainly see your expertise within the work you write. The sector hopes for more passionate writers such as you who aren’t afraid to mention how they believe. All the time follow your heart.

  24. Motrat Mustafa fotografi

    December 27, 2011

    I just wanted to thank you a lot more for that amazing blog you have produced here. It’s full of ideas for those who are truly interested in that subject, specifically this very post. You really are all so sweet plus thoughtful of others and also reading the blog posts is a wonderful delight in my opinion. And that of a generous surprise! Tom and I really have enjoyment making use of your points in what we need to do next week. Our record is a kilometer long which means your tips will be put to very good use.

  25. Karine Dickhaut

    January 3, 2012

    Its like you read my mind! You seem to know so much about this, like you wrote the book in it or something. I think that you can do with a few pics to drive the message home a little bit, but other than that, this is fantastic blog. A great read. I will definitely be back.

  26. click here

    February 18, 2012

    When all the people could invest in the topic, people for sure should do that, cause the topic is very nice presentment of it so each normal person would pay attentionto it. Because this is important but together is so very serious not forsingle individual, however actually for the population. Gratitudes!

  27. Magenband

    February 28, 2012

    Hm, this web site doesn’t look right to me when I browse to it using my iphone 3g. Maybe you might wanna optimize your web site for smart phone users too.

  28. Rayford Pettas

    February 28, 2012

    Thank you for spending some time on this

  29. Carroll Sniss

    March 19, 2012

    I have learn some excellent stuff here. Certainly price bookmarking for revisiting. I wonder how much attempt you set to make this sort of wonderful informative website.

  30. Charmane

    April 1, 2012

    You made a thoughtful point but I wonder, what about the other side of the coin?

  31. Freddie Haynes

    April 5, 2012

    Hey not to set off topic but can anyone give me overview of. New York Car Insurance Reform 295 Greenwich St, New York, NY 10007 (646) 351-0824 They can be down the block from me. I was wondering if they were a good insurance agency. I need to get coverage, it is the law you know, but I have to have a good price price plus I want friendly service.

  32. Mario Seidlitz

    April 5, 2012

    I just additional this website to my favorites. I delight in studying your posts. Tyvm!

  33. Afvallen Door Sporten

    May 6, 2012

    Nice post. I be taught something tougher on different blogs everyday. It would always be stimulating to read content material from other writers and apply a little one thing from their store. I’d choose to make use of some with the content material on my blog whether or not you don’t mind. Natually I’ll offer you a hyperlink on your net blog. Thanks for sharing.

  34. site

    May 31, 2012

    Im getting a small problem. I cant get my reader to pickup your feed, Im using bing reader by the way.

  35. no no hair removal system does it work

    June 16, 2012

    Excellent post. I was checking continuously this blog and I am impressed! Very useful info particularly the last part 🙂 I care for such info much. I was seeking this certain information for a long time. Thank you and good luck.

  36. Brian Herda

    July 4, 2012

    Headline News: Alex Jones saids beware of the Billionaire and the Millionaire Jewish people in your community, they worship the devil. They have infiltrated your government and work inside your government to turn your kids into devil worshipers. They are all in the Illuminati devil worshipers cult. Buy Guns and form your own militia groups to kill them all. Create a neighborhood watch in your country and in your town to track the Jewish people’s activity. These Jewish people worship Lucifer and they are there to destroy your country. They hide themselves in companies so they can do insider trading and bankrupt other good companies in your country. The Evil Jewish people have also poisoned your food and water supply just so they can make money from you by selling the cure. They are run by the Rothschild family, Rockerfeller family, Percy family, Rosenberg, Breakspear, Farnese, and aldobrandini family. Tell everyone.

  37. Jack

    July 21, 2012

    Hi, Why don’t you put a Google+ bottom on your blog ?

  38. Shea Provencal

    July 28, 2012

    Just a grinning visitant the following to express the take pleasure in

  39. Jerome Bried

    July 31, 2012

    Thanks a whole lot yet once more ! Very great post. I basically stumbled upon your blog in addition to wanted to state that We have in fact enjoyed reading your site content material. Sewer

  40. Gabriel Massingale

    September 5, 2012

    an ipad woww o_0 what an brilliant giveaway you rock world wide web style and design ledger

  41. pin find pinterst directory

    October 24, 2012

    What was the price around the Bell rocket motor? Contact details?

  42. Sarita Carlacci

    October 26, 2012

    Just simply want to tell you Now i’m ecstatic that i came in your page!|

  43. Guillermo Sharratt

    October 31, 2012

    Very neat blog.Really looking forward to read more. Keep writing.

  44. Toys

    October 31, 2012

    Awesome post. Cool.

  45. Full Guide

    November 4, 2012

    Hi! Quick question that’s totally off topic. Do you know how to make your site mobile friendly? My weblog looks weird when viewing from my iphone. I’m trying to find a template or plugin that might be able to fix this issue. If you have any suggestions, please share. Appreciate it!

  46. tres dimensiones

    November 23, 2012

    Im grateful for the post.Really looking forward to read more. Keep writing.

  47. 4cam

    November 25, 2012

    Simply desire to say your article is as astonishing. The clearness in your post is just spectacular and i can assume you’re an expert on this subject. Well with your permission let me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please keep up the gratifying work.

  48. Haywood Voskowsky

    December 11, 2012

    Yes! Finally someone writes about %keyword1%.|

  49. Art Plyler

    March 30, 2013

    I just like to mention I am unique to weblog and seriously loved your very own web-site. Extremely probably I’m going to bookmark your website . You completely come with awesome well written posts. Thanks a lot for revealing the web-site.

  50. the paleo recipes

    April 15, 2013

    The paleo is a health expert but really? Diseases like arthritis, hypertension, diabetes, colon cancer, diabetesand heart disease.

    Here is my web-site :: the paleo recipes

  51. half price sky player

    May 3, 2013

    Thanks for sharing your thoughts on glassfish. Regards

  52. 网购网站推荐

    May 12, 2013

    Very nice post. I just stumbled upon your blog and wished to say
    that I’ve really enjoyed browsing your blog posts. After all I will be subscribing to your rss feed and I hope you write again very soon!

  53. alasbarricadas.org

    May 17, 2013

    Woah! I’m really loving the template/theme of this site. It’s simple, yet effective.
    A lot of times it’s very difficult to get that “perfect balance” between usability and visual appeal. I must say that you’ve done a excellent job with
    this. In addition, the blog loads very fast for me on
    Chrome. Excellent Blog!

  54. Jesse

    July 1, 2013

    When I originally left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on every time a comment is added I receive four emails with the exact same comment. There has to be an easy method you can remove me from that service? Many thanks!

  55. Hailey

    July 1, 2013

    When I initially commented I appear to have clicked on the -Notify me when new comments are added- checkbox and now whenever a comment is added I recieve 4 emails with the same comment. Perhaps there is an easy method you can remove me from that service? Appreciate it!