Hibernate built-in Session Context Management

April 19, 2008

Starting with v3.1 (notice I work with 3.2.5ga though) Hibernate has introduced the interesting (and really helpful) concept of Session context management where Hibernate itself provides a built-in mechanism to manage the session.

In previous releases the session (and the transaction) had to be maintained by the developer, typically using the Thread Local pattern where the session is stored in a Java ThreadLocal class (more details here). Fortunately a much simpler way is provided by Hibernate v3.1.

Read the rest of this entry »


ApacheCon EU 2008 – Amsterdam

March 20, 2008

ApacheCon

Apache goes back to A’dam!

It’s fun-time again for the open source addicts: the Apache folks are back in the Netherlands (hotel Movenpick in Amsterdam) as last year.

Find schedule and all other details at the ApacheCon site.

I definitely recommend going: I attended last year and it was great. Lots of interesting sessions about state-of-the-art technology such as Axis2, Lucene, RESTful services, Web2.0, blogger API, Apache XAP, etc.. and many more.

I especially enjoyed the “Comparing Jave Web Frameworks” session, an enlightening overview of the most popular Java frameworks (Struts2, SpringMVC, JSF, Tapestry, Wicket,..). Excellent speaker (Matt Raible) who shared some priceless thoughts based his on experience.

Check my Resources page for some ApacheCon EU 2007 material.

Tips for ApacheCon-goers

Not to be missed in the DAM:

  • Brouwerij ‘t IJ (Funenkade 7): the amazing brewery in the windmill. Excellent beer (Zatte), unique atmosphere.
  • Pata Negra II ( Reinwardtstraat 1): best Spanish restaurant in town.. con tapas de puta madre
  • Bimhuis (http://www.bimhuis.nl/): Jazz music every night, next to the Movenpick
  • Rent a bike: Amsterdam is a different world on 2 wheels

Enabling SSL on JBoss 4.2.0

March 17, 2008

One of the prerequisites in order to install and configure CAS (Central Authentication Service), a popular open-source Single Sign-On, is to enable SSL on the web container. This can actually be quite painful, especially for developers who enjoy focusing on the implementation details rather than the infrastructure aspects (that would be me ;-) ).

In this post I present the steps required to enable the SSL support in JBoss 4.2.0: JSSE is required (bundled with JDK 1.4 or higher).

Little tip: when prompted use changeit as password as it is the default keystore password.

Delete existing certificates

This is step is not strictly required but it helps to get rid of previously created certificates (in case you have been playing around with the keystore). Run the following commands:

keytool -delete -alias localhost
keytool -delete -alias localhost -keystore “C:/Program Files/Java/jdk1.5.0_14/jre/lib/security/cacerts”

The first command removes the certificate with alias localhost from the user keystore, the second deletes the certificate from the system trusted certification repository.

The cacerts file is basically the system keystore which stores the CA (Certification Authority) certificates and can be found at ${java.home}/jre/lib/security/cacerts

Read the rest of this entry »


JBoss AS – Quick start in 5 minutes

February 22, 2008

JBoss AS is an open-source market-leader Java EE-based application server which enables the development and deploying of enterprise Java applications, Web applications and Portals.

There is exhaustive documentation at JBoss.com (JBoss AS web site and Product Datasheet to start with).

This post instead attempts to generate a five minutes “ready-steady-go” checklist with the basic steps to setup and use JBoss (*) for your development. Hopefully it can save you some time in the initial starting-up process. Good luck.

Install JBoss

  • Download the package from JBoss Download Center and unzip it.
  • Execute $JBOSS$/bin/run.bat
  • On your browser invoke http://localhost:8080

Understanding JBoss Directory Structure

JBoss top-level directory structure

  • bin: scripts
  • client: jars required by clients running outside JBoss
  • server: JBoss Server configuration (see below)
  • lib: JBoss Jar files (Do not place your own libraries in this directory).

Read the rest of this entry »


My guide to SCEA

February 1, 2008

SCEA (Sun Certified Enterprise Architect) is the most advanced certification in the Sun J2EE certification stack. It is intended for professionals responsible for designing and architecting J2EE applications.

I achieved the SCEA certification in Aug 2007 after passing the 3 different units: in this post I just want to summarise what SCEA is about and share my experience.

Sun fellas have recently upgraded (after long time) the SCEA certification to Java 5. I haven’t looked into it yet (hence this post is about the old version of SCEA) but I suspect the approach, exam and structure will be very similar.

Read the rest of this entry »