about greg
outofmemory: greg's blog
projects


Archive for the ‘Programming’ Category

Ganymede JSP Validation Issue

Friday, November 14th, 2008

Yesterday I had a heck of a time trying to figure out my my JSPs weren’t passing validation since I upgraded Ganymede from 3.4.0 to 3.4.1. There was a consistent issue where the JSP Validation did not like my scriptlet code, even when I dumbed it down to try even the simplest scriptlet. The validation errors looked like:

Syntax error on token "}", delete this token
Syntax error on token "catch", Identifier expected
Syntax error, insert "Finally" to complete TryStatement

I actually found out what my problem was through the Eclipse Web Tools usergroup. The issue for me was the use of the Spring form custom tag library. If you self-close the tag…

<form:errors path="*" />

…then you get the goofy JSP validation error. If you close the tag as if there was body content…

<form:errors path="*"></form:errors>

Then the error goes away. I need to follow-up with a bug for the Ganymede team.

Subclipse Tip on svn:keywords

Thursday, November 6th, 2008

Keywords in SVN are used to insert dynamic information about a file, into the file, presumably in a comment header.  The SVN manual discusses keywords, however when I was configuring my repository and eclipse projects, I had trouble getting them to update on commit.  I found a blog entry that discussed the keywords property in the server configuration, so I hopped on my server and set up the configuration accordingly.  I restarted the service and commited a file with the following header:

/**
 * @version svn:$Id$
 */

After the commit, the file did not update as expected. I did some further digging and found a forum post that discussed another option where you set the property on the file. So I experimented with that using the Team > Set Property … command in eclipse on a single file. Setting the property name to svn:keywords and value to Id. I made a simple change to my file and committed it again. Voila! It worked.

The last step was to apply this keyword to all of my files…and preferably not manually. The answer was to go to the root of my project and set the property there, noting to check the Set property recursively check box. If I want to add more keywords later on, I can by going to the root, modifying the svn:keywords property by adding other keywords (refer to the manual again) separated by a single space.

Synchronization Locks in Standard Taglibs Earlier Than v1.0.6

Wednesday, October 1st, 2008

Sometimes an oversight can lead to interesting results. We were testing a servlet-based application and in our test scripts, we had a hitch where if the script encountered an error, the re-try cycle didn’t have think time included. Which means anytime the script encountered an application error, it would then send re-try requests at a sub-second (inhuman) rate.

This increased our load from 10 pages per second to over 100 … our first indicator that something was wrong. We saw a corresponding spike in CPU from 8% to over 90% as the single JVM system tried to handle this new load. The application seized and thread dumps uncovered an interesting side effect. (more…)

OutOfMemory Errors During Deployment

Monday, August 25th, 2008

Some development teams I work with have been reporting an issue where the JVM runs out of memory during deployment of an application using our standard heap size settings (initial 2 GB and maximum 2 GB). When they changed the initial heap size from 2 GB to 512 MB, the no longer receive the OutOfMemory error. To understand what’s happening, continue on. (more…)

Understanding Sorting Algorithms

Wednesday, August 13th, 2008

Chris Coyier found a great visualization of sorting algorithms created by David R. Martin, an Assistant Professor at Boston College. If you’re new to sorting algorithms and Big O notation, check out the textbooks he references in addition to enjoying the fantastic visual representation.

Quantity Over Quality?

Monday, August 4th, 2008

Jeff Atwood quoted an interesting story that relates to the benefit of repetition and reinforces the point well here.

Turning Off the JIT Compiler

Saturday, July 19th, 2008

A colleague and I were having trouble tracking down the root cause of a production issue recently and we learned an interesting trick involving the JIT compiler. The issue was that after a certain period of time the JVM would go from 60 second GC intervals to less than 2 second intervals, coupled with a spike in CPU usage from 3% to 30% (light load). There was no correlation found in the application logs, but we could show that the reduction in interval was occurring at the same time as the increase in CPU usage.
(more…)

Spring Security Advisory

Wednesday, July 16th, 2008

The Server Side reports that Ounce Labs discovered two vulnerabilities in the Spring Framework’s MVC component.

SpringSource, the company behind Spring, issued a security advisory as a result. The two issues are entitled Data Submission to Non-Editable Fields and ModelView Injection.

Pass along the word to your friends and co-workers.

Inspiring Project

Thursday, July 10th, 2008

This guy wrote his own MMO using ASP, JS and MySQL. Pretty cool!

Google I/O Session Videos Posted

Monday, June 16th, 2008

For most of us who can’t afford the time (or expense) of attending technical conferences on even a semi-regular basis, Google was nice enough to post their sessions from the Google I/O conference online. I’ve really enjoyed each session I watched in the APIs & Tools section. There’s a lot about Google App Engine and developing with Python for that environment.

If you have any desire to try out GAE, start with this great introduction to developing on the GAE platform by Guido van Rossum, the creator of Python and current Googler.