migrate from maven2.x to maven3.x

Recently I migrated an application from maven2.x to maven3.x. And the only issue we faced was that profiles.xml was used in maven2. Here is the warning raised by maven3 while building. Since we had all the properties for building in profiles.xml so the first step we took was to copy these properties into pom.xml. And … Read more

maven properties in pom.xml converted to properties file

With maven 3.x profiles.xml is no longer supported. We had all our properties in the profiles.xml. So we changed to maven 3 and had to convert properties in profiles.xml to properties file. Here are the details about maven2.x to maven3.x migration   So here is the java utility class that reads the properties in pom.xml … Read more

Start background thread using spring on startup

In this tutorial we will start a thread on the application startup using spring bean.So we will start the thread using @PostConstruct annotation on the method. So this makes sure that the annotated method is called before the Spring bean is put into service.  And we will be using executor service to start a thread. … Read more

Properly Shutting down an ExecutorService

I was recently working on an application that used hibernate for db access and lucene for storing and searching text. This combination was really great. It made searching really fast. And tomcat was used as the application container.Sometimes I used to get this exception on redeploy: And also tomcat used to complain that it could … Read more

Lucene using spring.

Today we are showing how to instantiate lucene using spring. We will be using annotations for instating the spring bean. Lets jump directly to the example class to see how it is done So the above class is a singleton spring bean. The annotation PostConstruct on the method init make sure that lucene IndexWriter is started on the startup. … Read more

Scrum in 2 minutes

What is scrum? Scrum is an agile methodology that tries to overcome the issues with waterfall concept.What is a standup meeting? Standup meetings are daily meetings in which all the team gives status about the three questions: 1. What did i do yesterday? 2. What is blocking me? 3. What am i doing today? This … Read more

maven parallel builds

maven 3.x has bought in a great feature, the possibility of parallel builds. mvn -T 4 clean install # Builds with 4 threads mvn -T 1C clean install # 1 thread per cpu core mvn -T 1.5C clean install # 1.5 thread per cpu co  I have been doing some experiments with this parallel builds … Read more

log4j2 writing multiple files for multiple webapps in tomcat

As we moved to the latest version of the log4j. We were using log4j 1.x and now we upgraded to log4j 2.x. We have 4 webapps in single tomcat container and they all share the same log4j2.xml. This log4j2.xml is provided at the startup of the tomcat container using the property “log4j.configurationFile”. property In log4j2.xml we had … Read more