Tuesday, June 3, 2008

Hot-Deploy Makes Appfuse Cooler

Each time I change my .jsp or .java file, I must ant deploy to see the change in my application, it needs times, and after ant doing his job, tomcat also processing some bla bla things until it finished so I can open my web, it so consuming times, eventhough I only change my variable letter for example, and sometimes if tomcat not finished his bla bla things and I already open my app, it result me Perm gen error, I must kill -9 it from my terminal.

I was given by fellow to create hot-deploy and hot-deply-web-only, the last is if I only change my .jsp files, magically I donot need deploy anything if I modify the controller, just voila... it updated automatically. The first is if the last not worked, and if those still didn't work, I used the old deploy from appfuse. Here's the snipplet added in build.xml:

description="unwar into the servlet container's deployment directory">

description="unwar into the servlet container's deployment directory">

add this one line sintax in properties.xml:

Create new xml file, name it projectName.xml and write the following code (for example):
< context docbase="/home/wks-243/workspace/.../exploded/projectName" path="/projectName" >

&lt Context docBase="/home/wks-348/workspace/sigmalbu/exploded/sigmalbu" path="sigmalbu" /&gt

<context docbase="/home/wks-243/workspace/.../exploded/projectName" path="/projectName">
put it in $CATALINA_HOME/conf/Catalina/localhost/ directory

Shutdown your tomcat, and then ant hot-deploy, and then ant hot-deploy-web-only, and then start your server in debugging mode from your eclipse, and hope everything's fine.

Ok, afaik, the role is to copying everything the compile result into the exploded directory, so we donot need to compile manually if there is a change, it already compile and exist in exploded directory, unless we change our .jsp file, so we need to hot-deploy-web-only.


Anonymous said...

mam. ini pake netbeans ato eclipse? kalo eclipse kan bisa pake jetty. tinggal install plugin jettylauncher. ga pake deploy2an. setting2 bentar di jetty launcher, trus tinggal run. kalo ada coding yang diubah, tinggal restart jetty dari eclipsenya. kalo udah jadi baru dibikin war-nya. tp yah kalo emang harus spesifik appfuse ya ga tau sih :)

JesperBlog said...

aduuh, thank you banget first, maap aku ga pernah ngeblog, aku baru buka lagi skarang, soalnya mau mudik, jadi mau tak pamerin, ternyata ada comment kamu, maap ya ... baru tau loh aku comment kamu,

wah ok tuh aku baru tau sama jetty, maklum first newbie, btw aku pake eclipse, wah patut dicoba nih, ntar aku tanya2 lagi deh japri

thanks again!!