Thanks - this is working correctly I have checked the classpath in vissual vm and it contains jna, and cassandra-cli describe reports SerializingCacheProvider,
If you add jna a second time with the Sun jvm you seem to get the exception which had me wondering what cache provider was active. p -- java.class.path=/usr/share/cassandra/lib/antlr-3.2.jar:/usr/share/cassandra/lib/avro-1.4.0-fixes.jar:/usr/share/cassandra/lib/avro-1.4.0-sources-fixes.jar:/usr/share/cassandra/lib/commons-cli-1.1.jar:/usr/share/cassandra/lib/commons-codec-1.2.jar:/usr/share/cassandra/lib/commons-lang-2.4.jar:/usr/share/cassandra/lib/compress-lzf-0.8.4.jar:/usr/share/cassandra/lib/concurrentlinkedhashmap-lru-1.2.jar:/usr/share/cassandra/lib/guava-r08.jar:/usr/share/cassandra/lib/high-scale-lib-1.1.2.jar:/usr/share/cassandra/lib/jackson-core-asl-1.4.0.jar:/usr/share/cassandra/lib/jackson-mapper-asl-1.4.0.jar:/usr/share/cassandra/lib/jamm-0.2.5.jar:/usr/share/cassandra/lib/jline-0.9.94.jar:/usr/share/cassandra/lib/json-simple-1.1.jar:/usr/share/cassandra/lib/libthrift-0.6.jar:/usr/share/cassandra/lib/log4j-1.2.16.jar:/usr/share/cassandra/lib/servlet-api-2.5-20081211.jar:/usr/share/cassandra/lib/slf4j-api-1.6.1.jar:/usr/share/cassandra/lib/slf4j-log4j12-1.6.1.jar:/usr/share /cassandra/lib/snakeyaml-1.6.jar:/usr/share/cassandra/lib/snappy-java-1.0.3.jar:/usr/share/cassandra/apache-cassandra-1.0.1.jar:/usr/share/cassandra/apache-cassandra-thrift-1.0.1.jar:/usr/share/cassandra/apache-cassandra.jar:/usr/share/java/jna.jar:/etc/cassandra:/usr/share/java/commons-daemon.jar:/usr/share/cassandra/lib/jamm-0.2.5.jar java.class.version=50.0 ________________________________ From: paul cannon <p...@datastax.com> To: user@cassandra.apache.org Sent: Friday, 4 November 2011, 19:05 Subject: Re: Debian package jna bug workaroung The cassandra-cli tool will show you, if you're using at least cassandra 1.0.1, in a "describe" command. If not, you can make a thrift describe_keyspace() call some other way, and check the value of the appropriate CfDef's row_cache_provider string. If it's SerializingCacheProvider, it's off-heap. Note that I think you need to create the columnfamily while JNA is present, not just have JNA present when cassandra starts. Might be wrong on that. p On Thu, Nov 3, 2011 at 4:10 PM, Peter Tillotson <slatem...@yahoo.co.uk> wrote: Cassandra 1.0.1 and only seemed to happen with >* JAVA_HOME=/usr/lib/jvm/java-6-sun >and jna.jar copied into /usr/share/cassandra(/lib) > >I then saw the detail in the init script and how it was being linked > >Is there a way I can verify which provider is being used? I want to make >sure Off heap is being used in the default config. > > >On 03/11/11 19:06, paul cannon wrote: >> I can't reproduce this. What version of the cassandra deb are you using, >> exactly, and why are you symlinking or copying jna.jar into >> /usr/share/cassandra? The initscript should be adding >> /usr/sahre/java/jna.jar to the classpath, and that should be all you need. >> >> The failure you see with o.a.c.cache.FreeableMemory is not because the >> jre can't find the class, it's just that it can't initialize the class >> (because it needs JNA, and it can't find JNA). >> >> p >> >> On Wed, Nov 2, 2011 at 4:42 AM, Peter Tillotson <slatem...@yahoo.co.uk > >> <mailto:slatem...@yahoo.co.uk>> wrote: >> >> see below >> * JAVA_HOME=/usr/lib/jvm/java-6-openjdk >> works >> -- >> Reading the documentation over at Datastax >> “The Debian and RPM packages of Cassandra install JNA automatically” >> >> http://www.datastax.com/dev/blog/whats-new-in-cassandra-1-0-improved-memory-and-disk-space-management >> >> And indeed the Debian package depends on jna, and the >> /etc/init.d/cassandra looks as though in adds >> /usr/share/java/jna.jar to the classpath, and here is the but. >> >> If I copy or symlink jna.jar into: >> * /usr/share/cassandra >> * /usr/share/cassandra/lib >> Whenever a column family initialises I get: >> java.lang.NoClassDefFoundError: Could not initialize class >> org.apache.cassandra.cache.FreeableMemory >> >> This suggests to me that: >> 1) By default, for me at least, in Debian jna.jar is not on the >> classpath >> 2) There is an additional classpath issue >> jar -tf apache-cassandra.jar | grep "FreeableMemory" succeeds >> >> I'm running on: >> * Ubuntu 10.04 x64 >> * JAVA_HOME=/usr/lib/jvm/java-6-sun >> >> Full stack traces: >> java.lang.NoClassDefFoundError: Could not initialize class >> com.sun.jna.Native >> at com.sun.jna.Pointer.<clinit>(Pointer.java:42) >> at >> >> org.apache.cassandra.cache.SerializingCache.serialize(SerializingCache.java:92) >> at >> >> org.apache.cassandra.cache.SerializingCache.put(SerializingCache.java:154) >> at >> >> org.apache.cassandra.cache.InstrumentingCache.put(InstrumentingCache.java:63) >> at >> >> org.apache.cassandra.db.ColumnFamilyStore.cacheRow(ColumnFamilyStore.java:1150) >> at >> >> org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFamilyStore.java:1174) >> at >> >> org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFamilyStore.java:1131) >> at org.apache.cassandra.db.Table.getRow(Table.java:378) >> at >> >> org.apache.cassandra.db.SliceFromReadCommand.getRow(SliceFromReadCommand.java:61) >> at >> >> org.apache.cassandra.service.StorageProxy$LocalReadRunnable.runMayThrow(StorageProxy.java:797) >> at >> >> org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:1265) >> at >> >> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) >> at >> >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) >> at java.lang.Thread.run(Thread.java:662) >> INFO [pool-1-thread-1] 2011-11-02 10:26:46,738 Memtable.java (line >> 177) CFS(Keyspace='BigSet', ColumnFamily='theKeys') liveRatio is >> 18.20062753783684 (just-counted was 16.960966424636872). >> calculation took 408ms for 8169 columns >> ERROR [ReadStage:33] 2011-11-02 10:26:56,599 >> AbstractCassandraDaemon.java (line 133) Fatal exception in thread >> Thread[ReadStage:33,5,main] >> java.lang.NoClassDefFoundError: Could not initialize class >> org.apache.cassandra.cache.FreeableMemory >> at >> >> org.apache.cassandra.cache.SerializingCache.serialize(SerializingCache.java:92) >> at >> >> org.apache.cassandra.cache.SerializingCache.put(SerializingCache.java:154) >> at >> >> org.apache.cassandra.cache.InstrumentingCache.put(InstrumentingCache.java:63) >> at >> >> org.apache.cassandra.db.ColumnFamilyStore.cacheRow(ColumnFamilyStore.java:1150) >> at >> >> org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFamilyStore.java:1174) >> at >> >> org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFamilyStore.java:1131) >> at org.apache.cassandra.db.Table.getRow(Table.java:378) >> at >> >> org.apache.cassandra.db.SliceFromReadCommand.getRow(SliceFromReadCommand.java:61) >> at >> >> org.apache.cassandra.service.StorageProxy$LocalReadRunnable.runMayThrow(StorageProxy.java:797) >> at >> >> org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:1265) >> at >> >> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) >> >> > >