Archive for January, 2007

Using Spring with EJB 3

Sunday, January 28th, 2007

Back when we were planning the migration to Glassfish, I realised we would have two dependency-injection frameworks in use – EJB 3 and Spring. For obvious reasons, I wanted to know more about how these would interact. At the time (last July), I couldn’t find anyone who had used EJB 3 and Spring together – even Ben Alex from Interface21 hadn’t come across it. Six months later, and I still haven’t heard of anyone using Spring _from_ EJBs. Except for us.

(more…)

Tags: , ,

Testing EJBs without a container

Sunday, January 28th, 2007

One of the more annoying aspects of testing EJBs has always been the fact you need to bundle them up in a JAR (and often an EAR) and deploy them to a server to thoroughly test them. This process drags out the development of unit tests, and makes life generally painful.

As of EJB 3, however, it’s no longer necessary. instead, it is fairly trivial to mock out the container entirely (and safely!)

(more…)

Tags: , ,

Interfaces with EJB3

Saturday, January 27th, 2007

Starting last October, we went through a process of upgrading the main application at Wotif to be running under Java EE 5 (not just Java SE 5). The biggest part of this was upgrading from EJB 2 to EJB 3.

One of the things I noticed was that EJB3 gives you a lot of choices for how to implement and configure EJBs and their associated interfaces. There’s a lot of “standards” on how to do it, many of them conflicting, but very little explanation of why. This is the set of standards I came up with (and was largely successful in getting implemented), and why I chose them.

(more…)

Tags: , , , , ,

Running on Glassfish

Thursday, January 25th, 2007

Well, it took long enough, but it’s finally done:

Response Headers - http://www.wotif.com/

X-Powered-By: Servlet/2.5, JSP/2.1, JSP/2.1, JSP/2.1, JSP/2.1, JSP/2.1, JSP/2.1, JSP/2.1, JSP/2.1, JSP/2.1
Set-Cookie: PersistCountryCode=1; Domain=.wotif.com; Expires=Wed, 23-Sep-2037 22:11:45 GMT; Path=/
Content-Encoding: gzip
Content-Type: text/html;charset=utf-8
Content-Length: 11520
Date: Wed, 24 Jan 2007 22:11:45 GMT
Server: Sun Java System Application Server Platform Edition 9.0_01
Connection: close

200 OK

Phew. Now maybe I can get those backlogged EJB3-based articles out.

Tags: ,