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

Generating random integers using Random().nextInt(int bound)

In this tutorial we see how to generate a random number using the Random class in java and using the method  Random().nextInt(int bound). We will create a class named RandomIntegerGenerator. In this class we will use Random().nextInt(int bound) . It generates a random integer from 0 (inclusive) to bound (exclusive). Here we will set the bound … Read more

Convert a String to an int in Java

How to convert a String to an int in java? The Java Integer wrapper class provides a method parseInt to convert a String to an int.  Here is the method signature: One thing that you will note in the declaration is that the method also throws NumberFormatException.  Just note it for now, we will see below why this exception is … Read more