-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
I have been developping with ZK for a little while using Jetty and so I have to restart jetty everytime I change a java class. I'm finding that it really slows down development as Jetty takes around 10 sec to startup with my spring beans. How to you guys do it ? Do you restart the app server like I do ? Any way around it ?
Hi,
i'm do it in Tomcat.
- zul-files can be hot deployed
- for java-classes i must restart tomcat.
Stephan
Hi,
You can make a symbolic link to your Webcontent folder to the webapps tomcat folder and when you change a java class, this is automatically replicated in your runtime environment.
On windows this is done with the junction utility.
Fernando
@dasrultz
I think most of the time spent by Jetty is for starting the webapp, more than for Jetty itself. I tried with Tomcat and reloading the webapp still takes a couple of seconds and every 4-5 reloads I get a permgen memory error and I have to "kill -9" the jvm. Did you find a way around that ?
Thanks,
I would recommend to try out JavaRebel, it boosts your web-application development by reloading changed classes on the fly:
http://www.zeroturnaround.com/javarebel/
I'm using JavaRebel with ZK and Tomcat and it works perfectly. JavaRebel works far better than default HotReloading/-Swapping (setting JVM/Tomcat to reload apps/classes automatically):
http://www.zeroturnaround.com/javarebel/comparison/
HTH, Maik
Yes I know of JavaRebel and it looks very nice however, the 150$ per year price tag is not really an option for a personal project.
I am defining by composers as prototype scoped spring beans and using them in the apply attribute. ie:
<window apply="${mycomposer}">
From my reading, it is possible for the JVM to load a new version of a class file if it is loaded by another ClassLoader instance so I was thinking of setting a new instance of the ClassLoader in the application context on page creation but I have not been able to make it work yet because I have not been able to instantiate a new ClassLoader instance. Even if I was able to do so, it seems like I could run into another issue which is the app server caching class files. Anybody has any clues that could help me ?
I know that Wicket and Stripes both support hot class file replacement for the controllers. Not sure how they do it though.
I just found out there is a 60$ personal license so I might try it out. The other issue I have is that css, zul and image files loaded from the class-path needs a jetty restart when they are changed otherwise the unchanged version is used.
The files are located in WEB-INF/classes/web as per the ZK documentation. Is this a Jetty behavior ? Will switching to Tomcat solve this issue ?
@jtoupin regarding webapp restart and permgen:
Yes, my Tomcat takes 5-10 seconds to reload the webapp. Mostly closer to 5 except when I update a jar file.
On the PermGen issue, my catalina.sh / CATALINA_OPTS looks like this:
CATALINA_OPTS="-Xms128m -Xmx768m -XX:MaxPermSize=256m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8888,suspend=n"
sun.management.jmxremote.ssl=false -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled"
I got the info on PermGen elsewhere on this forum. The author claimed complete irradication of PermGen errors. I find it is greatly improved but not completely solved.
/Daryl
@dastultz
Thanks for the tip. I will try it out.
@mjablonski
I downloaded the eval version of javarebel and it is pretty impressive. I might buy it.
@jumperchen
I tried setting extendlet-check-period to 1 but I still have the same problem. Thanks for the help though.
Asked: 2009-04-03 13:25:39 +0800
Seen: 438 times
Last updated: Apr 07 '09