Spring Framework: “Hidden” Gems

The Spring Framework (and its portfolio projects) contain a lot of functionality already by themselves. However there are also some nice hidden gems inside the framework, in this blog I will (un)cover a couple of them. The code for the sample(s) can be found on Github.

Continue reading “Spring Framework: “Hidden” Gems”

Advertisements

Hibernate Search by Example

In short Hibernate Search by Example is a great how-to guide if you quickly want to get started with Hibernate Search.

Hibernate Search by Example is a thorough how-to guide to Hibernate Search. It shows and explains by clear examples how to setup and use Hibernate Search.

The book is clearly written and a pleasant read. It is not a long read but it still covers the basic and advanced features of Hibernate Search. It is not a full fledged reference guide but it gives you more than enough information to integrate Hibernate Search into your application(s).

The sample application which accompanies the book has an implementation using plain Hibernate as well as JPA. The plain hibernate sample comes with an annotation as well as an XML version. Basically there is a sample for each technology, which is a great plus for the book.

At last the book also shows some of the more advanced features of Hibernate Search and again shows more than enough code and information on how to implement and use these features.

Migrate classic J2EE to Spring (Step 1) (revised)

A couple of months ago I wrote a step 1 on migrating a classis J(2)EE application to a spring based application. Recently I had some time again on my hands and after studying the application and also after some discussions I had I decided to structure the project a little different.

“External” applications

The Adventure Builder applications uses 4 other applications to deliver its services. However in a normal real situation those 4 applications are outside of our control. We cannot change them nor redeploy them. So I decided to just include the ear files for those 4 projects instead of rebuilding them each time.

Generated stubs/skeletons

The application makes use of generated java and xml files. Also in a real situation you should generate those once and after that reuse. You should only (re)generate those files if the external interface changes (best would be to not generate at all). I decided to use the generated java files and xml files and include them in the project. They can be found in the src/generated directory.

Deployment

Deployment is now maven based, maven can start and create a glassfish domain for you. It will create all jms/jdbc/mail resources and deploy the 4 external applications. After that setup you can choose to start glassfish with the normal startServ command or reuse maven to start it. Simply run the setup.bat/setup.sh file from the setup directory. To deploy our own 2 applications simply go to the apps directory and type mvn glassfish:deploy.

Testing

The initial project as is has some test classes available so that we can make sure that the application still behaves as it should behave after we are going to change it to use Spring and Hibernate.

Hopefully Step 2 will follow shortly and that we can have a look at the different steps and easier code.

Migrate classic J2EE to Spring (Step 1)

A few months ago SpringSource released a white paper describing the migration from J2EE to a Spring framework based application. Even before they wrote that white paper I already had the idea of writing something about how to migrate from J2EE to a Spring based application. However Colin Sampaleanu (at al.) beat me to writing the white paper :).

However I also had the idea of providing some practical information like a sample. The white paper gives some thought on what to do and where but it doesn’t give a clear sample. So I started writing a possible migration path (multi step sample) from a J2EE application to a Spring based application.
Continue reading “Migrate classic J2EE to Spring (Step 1)”