14 Feb 2015 / posted by Nikku

There is probably around one thousand three hundred thirty seven static site generators out there. So why build a new one? Because it could be a 300 lines of code only, all-in-one, swiss army knife, hackable one. Kind of.

Continue reading ...

08 Dec 2013 / posted by Nikku

Recently I was looking at a project and wanted to capture a number of code metrics to see how the project developed over time. It turns out some interesting metrics can easily be extracted with basic shell scripting.

Continue reading ...

05 Jul 2011 / posted by Nikku

In my Jersey + Spring + JPA stack I recently came across an interesting issue: Throwing an exception inside a @Transactional annotated Spring bean method would cause a org.springframework.transaction.UnexpectedRollbackException in the outer container.

Continue reading ...

30 Oct 2013 / posted by Nikku

In a recent dive into spring framework proxies I was searching for a way to access real objects behind a proxy. That was required to fix field injection in jerseys jersey-spring3 extension.

It turns out that this is easily possible through the Advised interface that gets added to spring bean proxies as a management interface.

The interface provides the method getTargetSource()) that allows you to access the current proxy target source.

if (bean instanceof Advised) {
  Object realTarget = ((Advised) bean).getTargetSource().getTarget();


The above code does work for static proxy targets, only. It breaks if hot swapping or pooling is used because the target obtained may be different on each access.

Your application code should not use those internal interfaces, anyway. Your libraries may.

21 Oct 2013 / posted by Nikku

Working on an internationalized web application I realized that Glassfish 4.0 is still using ISO 8859-1 encoding to serve web resources. Too bad, as UTF-8 is the de facto standard for encoding on the web.

This short post shows my recipe to make glassfish ready for non latin1 languages.

Continue reading ...