0

Quick ZK development

asked 2009-04-03 13:25:39 +0800

jtoupin gravatar image jtoupin
156

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 ?

delete flag offensive retag edit

10 Replies

Sort by ยป oldest newest

answered 2009-04-03 13:44:35 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

Hi,

i'm do it in Tomcat.
- zul-files can be hot deployed
- for java-classes i must restart tomcat.

Stephan

link publish delete flag offensive edit

answered 2009-04-03 15:18:07 +0800

fselva gravatar image fselva
66 1

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

link publish delete flag offensive edit

answered 2009-04-03 18:37:55 +0800

dastultz gravatar image dastultz
797 9

I work in Tomcat as well. My development apps are set to be reloadable so no restart of Tomcat is required.

/Daryl

link publish delete flag offensive edit

answered 2009-04-04 18:03:56 +0800

jtoupin gravatar image jtoupin
156

@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,

link publish delete flag offensive edit

answered 2009-04-04 23:53:29 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

updated 2009-04-04 23:56:18 +0800

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

link publish delete flag offensive edit

answered 2009-04-06 14:21:57 +0800

jtoupin gravatar image jtoupin
156

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.

link publish delete flag offensive edit

answered 2009-04-06 15:53:16 +0800

jtoupin gravatar image jtoupin
156

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 ?

link publish delete flag offensive edit

answered 2009-04-07 00:55:36 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

Hi,

Please refer to the configuration of ZK xml file, which can be found here.

/Jumper

link publish delete flag offensive edit

answered 2009-04-07 00:59:16 +0800

dastultz gravatar image dastultz
797 9

@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

link publish delete flag offensive edit

answered 2009-04-07 01:34:35 +0800

jtoupin gravatar image jtoupin
156

@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.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-04-03 13:25:39 +0800

Seen: 438 times

Last updated: Apr 07 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More