Archive for category Spring

Combining Liquibase with Spring and JPA, revisited

In one of my previous articles, I described how you could combine Spring and Liquibase to make a schema self-updating JPA application. It has been a while since I wrote the article and a lot of things have changes. Both Spring and Liquibase have a new major version release out and a lot of API’s have changed. Read the rest of this entry »

1 Comment

Exploring Spring Integration 2.1

At my current assignment, one of the things that we do is reading XML files from an FTP site, do some magic on the contents and send the modified data to a REST service. If you’ve read some of my earlier posts, you’ve probably guessed this is done through an IBM product (Websphere Process Server). Given the fact that WPS is just an ESB with a BPM engine, I wanted to see how difficult it would be and how much faster I would be if I’d use an open source product for the ESB part (there’s an article coming on the BPM part too). As I’m a real Spring fan, I decided to give Spring Integration (I’ll refer to it as SI from now on) a go, as other products seemed a bit too much work to start with (Mule and ServiceMix have their own server implementation for starters…). Read the rest of this entry »

, ,

6 Comments

Having fun with JSON and DbUnit, continued

The beauty of a blog like this is the fact that people read the articles and take the ideas in them to the next level. And that’s exactly what Dan Haywood did.

He reused my JSONDataSet idea and combined it with JUnit 4′s new Rule system to add configurable dataset loading to individual test methods. It’s a basic, yet very functional implementation. But I thought, what the heck, let’s take his idea a step further. Read the rest of this entry »

3 Comments

Ensuring transaction safety when using the MySQL/JPA+Hibernate/Spring mix

When using JPA, using transactions is something one might take for granted. However, when you’re using MySQL and you’re not in control of the database, you may find yourself debugging a really hard bug: transactions that aren’t properly rolled back.
Read the rest of this entry »

No Comments

Creating a custom binder for Spring RCP

Introduction

For those not familiar with RCP, a quick heads-up. Spring RCP is a Swing application framework, based on the Spring Framework. It utilizes many of Spring’s available utilities, the Spring IOC container being the most important one.

Bindings and binders

Spring RCP gives you the possibility to create controls that are bound to certain properties of a given object. These bound controls are called bindings. A binder is a class that creates bindings. A binding factory, if you will.
Standard Spring RCP has some basic binders, but often you will encounter user requirements that require you to build a custom binder. For example, a binder to show a list of objects in a JTable, a binder to show a String in a formatted text field or even a binding to show and select an image. These are not standard in RCP, and you’ll need to make those yourself.
Read the rest of this entry »

1 Comment

Adding security to CXF web services

In my previous post, I demonstrated how easy it is to create REST services using Spring and CXF. Now I’ll show you something even easier: adding security.

For this example, I’ll start where I left off, which is a working REST service showing the time, and add basic HTTP authentication. I’ll be using Spring Security 3 to add the security features. Spring Security 3 is relatively new and those used to version 2 will need a wee bit of adjustment (you’ll need more jars, as they split them up). Read the rest of this entry »

8 Comments

Creating a REST service with CXF and Spring in 10 minutes

I love REST. It’s easy, straightforward and above all: easily testable. When you’re developing with REST, you have a lot of options to choose from. There’s Jersey, the reference Sun implementation, then you have RestEasy, the JBoss choice, and there is CXF, the Apache choice. I chose CXF for this example simply because it’s so easy to create REST services with it, without a lot of configuration. Read the rest of this entry »

26 Comments