What makes it different: Works in local tomcat and cloud foundry

I have an application that works fine on my local tomcat instance - it is a cassandra client application that uses Hector as a client library for Cassandra. The application creates a family of keys and columns (if it doesn't already exist) using the following code:

final ColumnFamilyDefinition cfDef = HFactory.createColumnFamilyDefinition(keySpaceName,
    columnFamilyName, ComparatorType.BYTESTYPE);
    cfDef.setKeyValidationClass(ComparatorType.LONGTYPE.getClassName());
    cfDef.setComparatorType(ComparatorType.UTF8TYPE);

cfDef.addColumnDefinition(new BasicColumnDefinition() {{
    setName(StringSerializer.get().toByteBuffer("id"));
    setValidationClass(ComparatorType.LONGTYPE.getClassName());
}});

      

When I push this same application to the cloud foundry (our own internal cloud where we have a simple cassandra service) the line above with "addColumnDefinition" throws an exception - here's the stack trace:

java.lang.UnsupportedOperationException
java.util.AbstractList.add(Unknown Source)
java.util.AbstractList.add(Unknown Source)
me.prettyprint.cassandra.service.ThriftCfDef.addColumnDefinition(ThriftCfDef.java:311)
org.pvtl.cassandra.HectorSample.createColumnFamily(HectorSample.java:94)
org.pvtl.cassandra.HectorSample.<init>(HectorSample.java:37)
org.apache.jsp.index_jsp._jspService(index_jsp.java:61)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

      

Bunch of googling and it looks like the problem is that the Hector code is trying to add to the immutable list - java.util.AbstractList. But again, this code works fine on my local tomcat instance, so I'm thinking about the difference in the jdk? May be? I am running java 7 (sun) locally and pushed the selection of java 7. Anyone have any ideas?

+3


source to share


1 answer


You are most likely using a different version Hector

in your local tomcat than the one on the server (i.e. the server has an older library) because the immutable list limit has been removed from newer versionsHector

Check out the discussion on this pull request



Edit

You might want to check your server configuration and make sure it has the latest library Hector

and / or check what hector-cor-xxx.jar

does not exist in your tomcat / jetty libraries folder as this could cause a dependency issue.

+3


source







All Articles