title: What's different: running in local tomcat vs. in cloud foundry
body: <p>I have an application that runs just fine in a local tomcat instance - it's a cassandra client app that uses Hector as a client library for Cassandra.  The application creates a keyspace and column family (if it doesn't already exist) using code like the following:</p>
  
  <pre><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());
  }});
  </code></pre>
  
  <p>When I push this exact same application to cloud foundry (our own internal cloud where we have a simple cassandra service), the line above with "addColumnDefinition" results in an exception - here's the stack trace:</p>
  
  <pre><code>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.&lt;init&gt;(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)
  </code></pre>
  
  <p>A bunch of googling and it looks like the trouble is that the Hector code is trying to add to an immutable list - the java.util.AbstractList.  But again, that code runs fine on my local tomcat instance so I'm thinking a difference in the jdk? Maybe? I'm running java 7 (sun) locally and pushed choosing java 7.  Anyone have any ideas?</p>