Integration:JPA, Hibernate, Spring, PMD, Cobertura...

It has been my experience that there are a lot of interesting technologies in the open source world and blogs which illustrate their elegant beauty but what I find is difficult is the integration of these gems. The focus of this blog is two fold:

  1. Integrate a number of open source projects.
  2. Create a web service which will provide URL Shortening services.

In this series of blog entries we will be adding new technologies as we precede through the core project.

The Core Project

The core project is to create a URL shortening service which is available through Web Services. This code will be of interest to those who might be interested in hosting their own URL shortening service but it is mostly to serve as a simple application to illustrate the integration of the following technologies:

  • Springframework 2.5.5
  • Hibernate 3.4
  • PMD
  • Cobertura
  • OpenEJB
  • JerseySpring (Rest)
  • SpringWS

Additionally a lot of attention will be given to the utilization of java annotations, were available, to construct the solution.

URL Shortening

To begin with URL Shortening, for those who have not dealt with this type of service before, is a service which shortens URLs. In some cases a shortened url is desirable.

Lets consider, for instance, the URL for the definition of URL Shortening as give by PC Magazine’s web site:,,t=url+shortening&i=53522,00.asp

73 Characters

That is 73 ugly characters long. If you are including this in a twitter message, which has a maximum of 250 characters, that is taking up a lot of your message space. Savvy twitters have started using URL shorteners to reduce the number of characters in their URL references. For instance if we put the above URL through a URL Shortening service such as we will get the following result: You can try for yourself using the links give.

The first article will lay down the foundation for development. It will utilize the following for code quality: JUnit 4 PMD Cobertura Springframework Testing API The application will be constructed from: JPA Hibernate SpringFramework EHCache The build environment is Maven2

About The Author

David Sells is a computer consultant in Toronto, Ontario who specializing in Java Enterprise Development. He has  provided innovative solutions for clients including: IBM, Goldman Sachs, Merrill Lynch and Deutsche Bank.

He also holds the following certifications:

  • Sun Certified Enterprise Architect for the Java Platform, Enterprise Edition 5 (2009)
  • Sun Certified Web Component Developer
  • Sun Certified Java Programmer.


Leave a Reply




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>