users@glassfish.java.net

Re: Is it possible to incrementally precompile JSPs?

From: <glassfish_at_javadesktop.org>
Date: Mon, 25 Jun 2007 22:21:49 PDT

Yuk!

Obviously, try the jspc to see if it helps.

If it doesn't, then I'd try this: Divide and conquer.

By that I mean don't deploy the whole app, just deploy, like, 10 JSPs at a time. When they come clean, move them to the DONE list, and rinse/repeat with the next 10.

If you include fragments of JSPs in to your parent JSPs, then try and compile those first. Try and create a fake "uber" JSP that includes everything you need so you can try an compile them all at once. And make a point in this process to throw out "known good" JSPs during your next cycle.

Also, look up how to use Java 6 and get faster JSP compiles. Even if you're not going to deploy with Java 6, you'll at least eliminate a bulk of your errors, and get faster compiles for this phase. And make sure your app server machine has plenty of memory. One of the killer problems with the app server during a JSP compile (especially not using Java 6) is it has to fork the entire image. So, if you have a 1GB Glassfish instance, when a JSP compiles, the system basically DUPLICATES ALL of Glassfish in virtual memory, it uses copy on write, so it's not copying every single page, but it's still a lot of work, and if you don't have the memory/swap space, your machine will thrash. Once it's done a copy of GF, the system dump GF and launches the jsp compiler, so this can be REALLY expensive.

But the general goal is to just break the app up in to manageable chunks and fix it in pieces.

Another thing you can do is create a list of all your JSP urls, create a shell or batch script that simply does a "wget xxx.jsp" (or a similar utility) on each one, and kick the sucker off over night. Ideally in the morning you'll have a bunch of files, some with compile errors.

Finally, something we do is we create a simple script that copies modified files from our dev tree to the deploy tree. So, that way you can edit a JSP in the dev tree, run the script real quick, then hit the JSP on the server without have to redeploy the entire application. rsync will do this, and there's some option for the Windows copy command (I don't know off the top of my head). Ant will do this too. Apps are generally deployed in the $domain/applications/j2ee-apps folder.

But if your problems are within the JSPs themselves, there's certainly no reason to have to constantly redeploy the application. Even if you just fix the JSPs in place in the deploy tree, you'll save time (just make sure to copy them out before you redeploy).
[Message sent by forum member 'whartung' (whartung)]

http://forums.java.net/jive/thread.jspa?messageID=223889