Friday, December 12, 2008

Workaround for mvn release:prepare failures

If you are using subversion 1.5.1+ like me you are likely to be frustrated by constant failures while attempting to use the Maven Release Plugin to prepare and perform releases.
There is a simple workaround for this which works like so:
  1. Run mvn release:prepare
  2. After if fails run svn update
  3. Run mvn release:prepare again
  4. Success!
The errror here appears to be caused by changes in subversion 1.5.1 so hopefully that will be fixed in the future.

Monday, August 11, 2008

Using find to locate duplicate or missing classes

I found this super useful find command on the webspherehelp blog which I am pasting below:
find . -name '*.jar' -o -name '*.war' -o -name '*.ear' -type f |xargs -i bash -c "jar -tvf {}| tr / . | grep CLASSNAME && echo {}"
Just change the sample Classname to the one you are getitng a conflict with.
It will search though all files in the current directory (or whereever you point the find command) and locate every class file which matches the CLASSNAME text. Very useful.
I needed this to track down a java.lang.LinkageError recently and it worked like a charm.
Here is the original blog posting.

Tuesday, July 22, 2008

Gmail address matching craziness

This is so crazy it must be blogged about. I got an email which I should have gotten even though it was not actually addressed to me. You are thinking that I am crazy because email does not work that way. Normally I would agree, but check this out:
An email sent to was delivered to me.
Note that my real address is:

Here are the headers to prove it (chopped out some extra bits to protect the sender):
Received: by with SMTP id e11cs256039ybm;
Tue, 22 Jul 2008 11:02:35 -0700 (PDT)
Received: by with SMTP id c13mr2655883ang.47.1216749755360;
Tue, 22 Jul 2008 11:02:35 -0700 (PDT)
Received: from ( [])
by with ESMTP id c40si8810491anc.30.2008.;
Tue, 22 Jul 2008 11:02:35 -0700 (PDT)
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: multipart/alternative;
X-MimeOLE: Produced By Microsoft Exchange V6.5
X-OriginalArrivalTime: 22 Jul 2008 18:01:01.0106 (UTC) FILETIME=[E68D5920:01C8EC24]
Subject: Transfer
Date: Tue, 22 Jul 2008 14:01:45 -0400
Message-ID: <>

Seriously, how cool is that?

Saturday, June 07, 2008

Marist Sakai Bootcamp

We just wrapped up the Sakai Marist Bootcamp which ran from June 2nd through the 6th at Marist College in PoughKeepsie, New York, USA. There were 32 participants from universities in Michigan, New York, Maryland, Ohio, Hawaii, Canada (not comprehensive) and commercial groups like IBM, rSmart, Unicon, and Serensoft. This is the first Sakai bootcamp of 2008 and I guess something like the 10th one I have taught overall.
Topics covered included Sakai installation and development environments, Eclipse usage, Sakai code structure, development practices and tips, and various Java development tips. Participants had quite a varied level of knowledge from those who were new to Java and Sakai to those who had been using Java for 10+ years and Sakai for 3+ years. There were participatns from higher ed and K-12. Marist is helping provide Sakai services for K-12 schools around NY state and I had a chance to see how they are using Sakai. I felt like the workshop went really well and I enjoyed my time in Poughkeepsie, NY.
Our hosts at Marist treated us very well and provided lunch and snacks every day and a great location to have the workshop. We went to Shadows (a semi open air restaurant along the river) on Tuesday evening and had a good time with fairly traditional upscale american dining. I was honored to have a chance to meet a dean and the president of the college on the last day.
Cheers to everyone who organized things and gave me a chance to come to NY and hopefully expand the Sakai community.

Flickr photos are posted here:

Saturday, May 17, 2008

Maven2 hibernate DDL generation

I needed a way to get hibernate to generate DDL for me and I ended up using the hibernate maven plugin. It took a lot of trial and error to get it working so hopefully this will save someone some time when they try to do the same thing.

In case you are not familiar, Hibernate is an ORM package for Java that allows you to treat your database like a collection of objects (sort of). Maven2 is a java build system (like ant or make). DDL is data definition language and tends to be unique for every database so if you want a project to work with multiple databases then you have to create DDL for each one. That's where this comes in to play. Normally hibernate will generate DDL and run it for you but this is not always desirable. Especially when dealing with production systems which already have a large database. This will allow you to generate the DDL right in the source of your project and then simply commit the DDL files back to your source repository. If you change your hibernate mapping files then regenerate the DDL and commit the changes.

I created a simple folder with the right pom.xml and the other needed support files to allow a developer to generate DDL by just running mvn install in their ddl folder (the one with these files). You can download that to get started. There is a little bit of setup required which is detailed on my wiki page about generating DDL using hibernate and maven2. Checkout the readme which explains how to use it. I would think it is probably 10 minutes of effort to add this to an existing hibernate project which is using maven 2.

Sunday, May 11, 2008

Fun with Maven 2 dependencies

I learned some new Maven 2 tricks this weekend while experimenting with things. In general it can be a real pain when you are developing a piece of framework code which a few projects depend on and you find a minor issue which requires a new release. Typically you have to go around updating lots of POMs. Well, no longer! In maven 2 you can now specify version ranges which can save you a lot of updating when newer versions of packages come out.
Normal maven 2 depedencies look like this:


Unfortunately, if a bug fix is released for this which is 1.3.4 then I will not pick up on the new version and would have to explicitly put it in. However, if I want to pick up any minor version updates for a project and I want the minimum version to be 1.3.3 (but less than 1.4.0) I can do this:


A word of warning though, if the packages you are using do not adhere to standards of versioning you can really get in trouble if a new version comes out with an incompatible interface. Of course, if that happens you simply adjust the version range in the POM.

More info here:

Thursday, May 08, 2008

EntityBroker 1.3.3 released

The new 1.3.3 version of EntityBroker is released. This includes a bunch of new features to make working with Sakai easier but the biggest improvement is full support for RESTful URLs. Now a developer can write an EntityProvider and implement a handful of interfaces and end up with REST access to their entities. This now allows developers to expose data from within Sakai to be read and written via REST calls by other Sakai apps, Sakai helpers, external apps (PHP, Perl, etc.), and client side widgets. This includes support for transformation of entity POJOs to and from JSON and XML automatically. Like everything else in EB, this can be disabled or controlled explicitly if desired. More details on the RESTful entities page.
The other major change in this release is the DeveloperHelperService. This is a shared service that the EntityBroker provides. This service makes it easier to deal with current Sakai data as entity references. Methods include getting current user/location/tool and generating URLs to work with entites and within Sakai. It also provides for some protection against shifting Sakai service APIs as this service API will remain stable and allow access to common things like current user and site without requiring knowledge of the Sakai service structure.
There are few minor improvements in the new version like support for persistent entity properties (without using hibernate) and support for persistent entity tags. There are also improvements in the classloader handling to ensure that the entity system will not hold onto class resources when a classloader reloads (e.g. webapp reload). Thanks to testing by Stephen Marquard this release should be fully backwards compatible with the pervious version.

Sunday, May 04, 2008

GenericDao 0.9.5

The 0.9.5 version of GenericDao is now available. This provides the biggest leap in functionality yet with enhancements including support for JDBC and pure SQL (along with Hibernate) and new search methods which use a generalized Search object to make it easy to control restrictions, limits, ordering and bascially everything you would want to put in a search for an object.
For anyone unfamiliar with the package it is mostly a bunch of convenience code to make it a little easier to have ORM like functionality and not have to write the same boring create/update/find/delete methods over and over again. It also provides a simple and extendable interface for working with persistent objects.
I am using the new version to replace the previous hibernate usage in a couple of projects and things seem to work quite well so far. The new version builds on some of the Apache projects like BeanUtils, Google projects like Guice, and the Spring Framework.
I hope to add in support for DDL generation using Apache DDLUtils in the next release.

Download (Maven2):
Maven site:

On a related note, this release was made using the Maven 2 release plugin which made the process very clean and easy. I recommend it highly.

Wednesday, February 27, 2008

Subversion Keywords

I finally got around to putting in SVN keywords in some of the files for the Evaluation System project. It took me a little while to figure this out but they don't start working automatically. You have to take the extra step of telling Subversion (via properties) that you want it to actually do the keyword substitution. Luckily the steps are pretty easy once you figure it out.

1) Add some keywords to your files like so:

2) Run this command from the base directory of your project (this will add all the keywords, just remove the ones you don't want from the string):
svn propset -R svn:keywords "Date Revision Author URL Id" .
3) Commit the code (this will take awhile because it is going to commit a new revision of every file in your project). The keywords will be replaced and look more like this:
$Id: 46025 2008-02-27 13:01:48Z $

Disappointingly this will not work for all files going forward so you will have to reapply this for new files or just do the whole set every once in awhile.

Sunday, January 27, 2008


I was roaming around the web and ran into a web application that used Silverlight this weekend. I did a little investigating and this weems to be Microsoft's answer for Flash and Rich Internet Applications in general. They make a lot of interesting claims about cross browser compatibility (IE, Firefox, and Safari) and compatibility with existing backends and AJAX. The big score for it though seems to be the claim that it is fully accessible and that the toolkit helps you make your apps more accessible and l10n. Overall, it looks pretty compelling and fairly easy to learn so I plan to keep an eye on it and see where it goes.

Main websites:

A really cool use of Silverlight:

A blog/analysis of it from a developer prespective:

A demo/interview of Silverlight on Youtube:

Linux related project (Moonlight):

Related (competing) projects:
Adobe AIR:
Google Gears: