Maven annoyances: “Web.Xml Is Missing And Is Set To True”

So you are getting this error in your Eclipse IDE

web.xml is missing and <failOnMissingWebXml&gt> is set to true

Here how you fix this silly error

Right click the project->Java EE Tools->Generate Deployment Descriptor Stub

Voila. Problem fixed.

Java and Cassandra setup on an AWS Linux server

Java 7 Setup

# First verify the version of Java being used is not Oracle JDK.
java -version

# Get the latest JDK 7 from Oracle
# Install Java
sudo rpm -i jdk-7u71-linux-x64.rpm
# Check if the default java version is set to Oracle jdk
java -version

# If not then lets create one more alternative for Java for Oracle JDK
sudo /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_71/bin/java 20000
# Set the Oracle JDK as the default java
sudo /usr/sbin/alternatives --config java

# Verify if change in SDK was done.
java -version

Cassandra Setup

Download Cassandra from

  • Unzip/Untar the file apache-cassandra-2.1.0-bin.tar.gz
    • Copy the Cassandra folder apache-cassandra-2.1.0 to /usr/share
  • Edit the file /usr/share/apache-cassandra-2.1.0/conf/cassandra.yaml if necessary
  • Make sure /var/lib/cassandra has sufficient space

Start cassandra using the command:


Collections.sublist() not serializable

Ran into a strange serialization issue when trying to add a Java class to memcached…

Caused by: java.util.RandomAccessSubList

The problem was with a class member that was initialized with Collections.sublist() method. This method returns an instance of java.util.RandomAccessSubList which is not serializable.

The solution was to wrap initialize the list as an ArrayList.

new ArrayList<String>(biglist.subList(2, 4))