spring override alias

In a try to make it easy to override some service while using the original definition as parent I was using some alias for it.
orig.ac.xml:
<bean class=”SomeService>
<property name=”servicex” ref=”servicex”/>
</bean>
<bean id=”servicexImpl” class=”servicexImpl”>
….
</bean>
<alias alias=”servicex” name=”servicexImpl/>
additional.ac.xml
<bean id=”servicex” class=”ServicexAltImpl” parent=”servicexImpl”/>
So I was thinking now that SomeService would now use the ServicexAltImpl for servicex.
However it turn out that this doesn’t work. [...]

Spring transaction proxy pitfall

On the spring documentation website (http://static.springsource.org/spring/docs/2.5.6/reference/transaction.html) you’ll find this nice drawing of a spring transaction proxy :

However when this target method calls another target method in the same class with a different transaction setup the new transaction setup is ignored. The transaction setup of the first target method will be used for all calls to [...]

Apache Camel Type Converters and Spring

Camel allows you to define Type Converters by putting the annotation @Converter at class and converter-method level. You need to define a file META-INF/services/org/apache/camel/TypeConverter, which contains a comma separated list of packages Camel has to scan for Converter classes.
All fine as long as your Converter doesn’t need any dependencies injected. The Camel manual ‘extensively’ describes [...]

Spring tip: reference to a factory bean

Imagine having a factory bean like MethodInvokingFactoryBean or MapFactoryBean (or any factory bean, but I’ll use these two as an example) and you want to call it using getApplicationContext().getBean(”myFactoryBean”).
In case of the MethodInvokingFactoryBean you will get the returnvalue of that method back (which can be “null”, even though getApplicationContext().contains(”myFactoryBean”) returns “true”) . If you’re [...]

Precise dynamic logging with Log4j

Our flagship product, Supply-It, is a planning application that (amonst others) is capable of scheduling the complete workload of production plants. This can results in quite elaborate plannings with numerous production orders.
The logic that caused the planning to be what it is, is often quite complex and it may often be tough to understand [...]

Binders must be stateless

‘Spring RCP gives you the possibility to create controls that are bound to certain properties of a given object. This given object is in most cases a gui object. The bound controls are called bindings. A binder is a class that creates bindings. A binding factory, if you will. ‘
When creating a binder via spring [...]

Data storm

In our product team, we have a whole bunch of unit tests that load data from an XML dataset into an in-memory (HSQLDB) database.
We’re using the Unitils framework to load this data into the db, without constraints enabled.  This allows us to load only the data that concerns the test (another approach would be to [...]