Category Archives: java

Liquibase + Hibernate 5 + Envers + Spring Boot Naming Conventions

Starting with a project using Spring Boot 1.5.8 and Hibernate 5.2.12 I implemented Liquibase to handle database schema changes. This is all straight forward enough, with plenty of other tutorials of how to setup the runtime side. The schema diff … Continue reading

Posted in Gradle, java, JPA | Leave a comment

Null and JPA2 Native Query in MSSQL

This post involves a slightly edge case scenario that I encountered a couple of months ago, so hopefully I get all the details right the first time. Essentially, I had a JPA2 project using Hibernate 3.6.10 as the ORM. This … Continue reading

Posted in java | Leave a comment

Reloading Tiles2 Config in Spring 3.x

When you are using Tiles for layout composition with Spring you configure it as a view resolver by adding something like this to the applicationContext.xml     <!– Configure the Tiles templates –>     <bean id=”tilesConfigurer”         class=”org.springframework.web.servlet.view.tiles2.TilesConfigurer”>        … Continue reading

Posted in Spring | 1 Comment

Spring MVC Validation BindingResult

A quick note about using the BindingResult to detect and report errors in a form. One gotcha that got me was the need to set a name on the @ModelAttribute in order to properly relate the form:form commandName and the … Continue reading

Posted in java, Spring | 2 Comments

Programmatically getting the Maven version of your project

It is often handy to be able to extract the Maven version of your project at run time, either for displaying in an about box, or in debugging information. One option is to read /META-INF/maven/${groupId}/${artifactId}/ However, this file is only … Continue reading

Posted in java, Maven, programming | 1 Comment

Debugging connection pool leak in Apache HTTP Client

I recently had an issue using the Apache HTTP Client pooling library where after a while threads would just block when trying to open connections. It didn’t take too much to figure out that the thread pool was being exhausted, … Continue reading

Posted in java | 1 Comment

Spring @Autowired – Use interfaces!

Here’s a little lesson that I had to relearn today: When using Spring use interfaces. The premise was I had a DAO bean that was configured with Spring, and it was @Autowired into my controller (or test case in this … Continue reading

Posted in Spring | 1 Comment

Preauth in Spring Security 3.x

Sometimes in a webapp you will be in a situation where a filter/app/container other than Spring will be responsible for authenticating a user and setting the user principal, leaving the authz to the Spring webapp. A portlet container is a … Continue reading

Posted in java, Spring | Leave a comment

ZSI -> CXF: Parameters coming in as NULL

Recounting a strange little compatibility issue I had between ZSI 2.0 and CXF 2.0.x. I was using CXF as the server, running from Maven using Jetty, and ZSI as the client. The parameters from the ZSI were arriving at the … Continue reading

Posted in java, python, Work | Leave a comment

Zope3 Component Architecture (CA) style Adapters for Java

After programming for Zope3/Plone for the past year I’ve come to really admire the flexibility and elegance that their implementation of the adapter pattern gives us. And, after Martin Aspeli put the call out almost a year ago, and it … Continue reading

Posted in java, plone, programming | 1 Comment