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.
November 18th, 2007 on 11:17 AM
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):
November 18th, 2007 on 11:19 AM
content of sun-web.xml:
/seamsample2
March 10th, 2008 on 11:26 AM
In windows, how to “touch” a file?
How to make NetBeans touch the file automaticly after some .java files are changed?
February 25th, 2010 on 11:02 PM
Thank you very much.
I have also specified the parameter contextroot to define the name to call the web application.
May 19th, 2010 on 11:03 AM
we have an Automotive shop at home because my dad and i loves automobiles. -:”
March 13th, 2011 on 9:43 AM
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
August 19th, 2011 on 1:34 PM
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!
August 23rd, 2011 on 2:56 AM
You have observed very interesting details! ps decent website.
September 10th, 2011 on 2:01 PM
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?
September 19th, 2011 on 3:31 AM
Keep writing. Your work is excellent.
September 21st, 2011 on 6:47 PM
The test is great. Not only well-written but also educational and inspirational.
October 8th, 2011 on 6:27 PM
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.
October 16th, 2011 on 4:45 PM
Hunte347@yahoo.com
October 16th, 2011 on 8:11 PM
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!
October 22nd, 2011 on 11:45 PM
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.
October 23rd, 2011 on 1:02 AM
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.
October 23rd, 2011 on 10:21 AM
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.
November 9th, 2011 on 2:11 AM
Very interesting subject, thank you for posting.
November 13th, 2011 on 5:35 PM
There is obviously a bunch to identify about this. I feel you made some nice points in features also.
November 14th, 2011 on 2:58 PM
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.
November 28th, 2011 on 2:50 AM
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.
November 30th, 2011 on 6:18 AM
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.
December 9th, 2011 on 6:35 AM
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.
December 10th, 2011 on 2:49 AM
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.
December 27th, 2011 on 1:00 PM
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.
January 3rd, 2012 on 7:14 AM
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.