Tag Archives: Spring Framework

Getting started with Spring Integration v2 and Enterprise Integration Patterns – A Simple Example using File and Mail Adapters


I’ve recently had a requirement to do some Enterprise Integration stuff and tried out Spring Integration for it. I’ve found it to be simple, easy-to-use, and flexible. So, I thought of sharing it with you all. Here’s the requirement: A daemon program should look for XML files in a particular directory every ‘n’ minutes and […]

Got a mention in SpringSource announcements for this week – feels nice :)


It always feel nice to get recognized for something you do, and I’m happy it happened today. My post – Aspect Oriented Programming with AspectJ and Spring AOP – A simple example to create logging aspect – got a mention in SpringSource News & Announcements for this week (This Week in Spring: September 6th, 2011). […]

Migrating from EJB to Spring and from JBoss to Apache Tomcat: A Real-Life Case Study of Hyperic v4.5 Release


This case study on migrating the open source web application monitoring and management software, Hyperic, to the Spring Framework and Apache Tomcat was originally delivered by Jennifer Hickey at the 2010 SpringOne 2GX conference. This migration work was done for Hyperic v4.5 release. Here are some of the advantages cited about this migration: 1. Improved […]

Getting started with Velocity templating engine: Constructing HTML content in a Spring-based Java application


1. Create a velocity template file – say, helloworld.vm, and add this to classpath. Add some html content. 2. If I want to make ‘Hello World’ part dynamic, here’s what you need to do. 3. Now, to ask Velocity engine to replace the helloContent dynamically, i) construct a map and add a key ‘helloContent’ and […]

Loading configurable parameters from properties files into Spring bean context definitions using PropertyPlaceholderConfigurer – An example


Using Spring‘s PropertyPlaceholderConfigurer to load configurable parameters in properties files – An example Here’s a context definition for a bean in XML: JDBC properties, though made configurable in the above XML context definition, it’d be better if we dynamically get these values from a properties file kept centrally and shared by all the applications. Use […]

How to resolve HibernateObjectRetrievalFailureException (org.hibernate.ObjectNotFoundException: No row with the given identifier exists exception)?


Quite recently, we were getting the below exception in one of our stand-alone java application: org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException: No row with the given identifier exists: [example.hibernate.pojo.Person#10878]; nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [example.hibernate.pojo.Person#10878] at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:660) at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424) at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) at org.springframework.orm.hibernate3.HibernateTemplate.loadAll(HibernateTemplate.java:595) . . . Caused by: org.hibernate.ObjectNotFoundException: No row with […]

Using CachingConnectionFactory with Spring JmsTemplate: What problem does it solve?


From Spring framework API docs for org.springframework.jms.core.JmsTemplate, “…The ConnectionFactory used with this template should return pooled Connections (or a single shared Connection) as well as pooled Sessions and MessageProducers. Otherwise, performance of ad-hoc JMS operations is going to suffer. The simplest option is to use the Spring-provided SingleConnectionFactory as a decorator for your target ConnectionFactory, […]