Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4A557941E for ; Fri, 4 Nov 2011 19:06:05 +0000 (UTC) Received: (qmail 43958 invoked by uid 500); 4 Nov 2011 19:06:02 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 43937 invoked by uid 500); 4 Nov 2011 19:06:02 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 43929 invoked by uid 99); 4 Nov 2011 19:06:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2011 19:06:02 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of paul@datastax.com designates 209.85.216.44 as permitted sender) Received: from [209.85.216.44] (HELO mail-qw0-f44.google.com) (209.85.216.44) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2011 19:05:55 +0000 Received: by qadc10 with SMTP id c10so3103144qad.31 for ; Fri, 04 Nov 2011 12:05:33 -0700 (PDT) Received: by 10.50.169.1 with SMTP id aa1mr14149243igc.9.1320433533357; Fri, 04 Nov 2011 12:05:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.40.18 with HTTP; Fri, 4 Nov 2011 12:05:12 -0700 (PDT) X-Originating-IP: [64.132.24.216] In-Reply-To: <4EB30343.9090206@yahoo.co.uk> References: <1320226927.23473.YahooMailNeo@web132105.mail.ird.yahoo.com> <4EB30343.9090206@yahoo.co.uk> From: paul cannon Date: Fri, 4 Nov 2011 14:05:12 -0500 Message-ID: Subject: Re: Debian package jna bug workaroung To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=e89a8f23545db48e6f04b0ed6323 X-Virus-Checked: Checked by ClamAV on apache.org --e89a8f23545db48e6f04b0ed6323 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 wrot= e: > Cassandra 1.0.1 and only seemed to happen with > * JAVA_HOME=3D/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 > > wrote: > > > > see below > > * JAVA_HOME=3D/usr/lib/jvm/java-6-openjdk > > works > > -- > > Reading the documentation over at Datastax > > =E2=80=9CThe Debian and RPM packages of Cassandra install JNA autom= atically=E2=80=9D > > > http://www.datastax.com/dev/blog/whats-new-in-cassandra-1-0-improved-memo= ry-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=3D/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.(Pointer.java:42) > > at > > > org.apache.cassandra.cache.SerializingCache.serialize(SerializingCache.ja= va: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(ColumnFamilySto= re.java:1174) > > at > > > org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFamilySto= re.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(S= torageProxy.java:797) > > at > > > org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StoragePr= oxy.java:1265) > > at > > > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor= .java:886) > > at > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.jav= a: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=3D'BigSet', ColumnFamily=3D'theKeys') liveRatio i= s > > 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.ja= va: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(ColumnFamilySto= re.java:1174) > > at > > > org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFamilySto= re.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(S= torageProxy.java:797) > > at > > > org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StoragePr= oxy.java:1265) > > at > > > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor= .java:886) > > > > > > --e89a8f23545db48e6f04b0ed6323 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable The cassandra-cli tool will show you, if you're using at least cassandr= a 1.0.1, in a "describe" command. =C2=A0If not, you can make a th= rift describe_keyspace() call some other way, and check the value of the ap= propriate CfDef's row_cache_provider string. =C2=A0If it's Serializ= ingCacheProvider, it's off-heap. =C2=A0Note that I think you need to cr= eate the columnfamily while JNA is present, not just have JNA present when = cassandra starts. =C2=A0Might be wrong on that.

p


On Thu, Nov 3= , 2011 at 4:10 PM, Peter Tillotson <slatemine@yahoo.co.uk> wrote:
Cassandra 1.0.1 and only seemed to happen wi= th
* JAVA_HOME=3D/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? =C2=A0The initscript should be adding
> /usr/sahre/java/jna.jar to the classpath, and that should be all you n= eed.
>
> 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 initiali= ze the class
> (because it needs JNA, and it can't find JNA).
>
> p
>
> On Wed, Nov 2, 2011 at 4:42 AM, Peter Tillotson <slatemine@yahoo.co.uk
> <mailto:slatemine@yahoo.co.uk>> wrote:
>
> =C2=A0 =C2=A0 see below
> =C2=A0 =C2=A0 =C2=A0* JAVA_HOME=3D/usr/lib/jvm/java-6-openjdk
> =C2=A0 =C2=A0 works
> =C2=A0 =C2=A0 --
> =C2=A0 =C2=A0 Reading the documentation over at Datastax
> =C2=A0 =C2=A0 =E2=80=9CThe Debian and RPM packages of Cassandra instal= l JNA automatically=E2=80=9D
> =C2=A0 =C2=A0 http://www.datastax.com/dev/blog/whats-new-in-cassandra-1-0-improved-memor= y-and-disk-space-management
>
> =C2=A0 =C2=A0 And indeed the Debian package depends on jna, and the > =C2=A0 =C2=A0 /etc/init.d/cassandra looks as though in adds
> =C2=A0 =C2=A0 /usr/share/java/jna.jar to the classpath, and here is th= e but.
>
> =C2=A0 =C2=A0 If I copy or symlink jna.jar into:
> =C2=A0 =C2=A0 =C2=A0* /usr/share/cassandra
> =C2=A0 =C2=A0 =C2=A0* /usr/share/cassandra/lib
> =C2=A0 =C2=A0 Whenever a column family initialises I get:
> =C2=A0 =C2=A0 java.lang.NoClassDefFoundError: Could not initialize cla= ss
> =C2=A0 =C2=A0 org.apache.cassandra.cache.FreeableMemory
>
> =C2=A0 =C2=A0 This suggests to me that:
> =C2=A0 =C2=A0 =C2=A01) By default, for me at least, in Debian jna.jar = is not on the
> =C2=A0 =C2=A0 classpath
> =C2=A0 =C2=A0 =C2=A02) There is an additional classpath issue
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0jar -tf apache-cassandra.jar | grep = "FreeableMemory" succeeds
>
> =C2=A0 =C2=A0 I'm running on:
> =C2=A0 =C2=A0 =C2=A0* Ubuntu 10.04 x64
> =C2=A0 =C2=A0 =C2=A0* JAVA_HOME=3D/usr/lib/jvm/java-6-sun
>
> =C2=A0 =C2=A0 Full stack traces:
> =C2=A0 =C2=A0 java.lang.NoClassDefFoundError: Could not initialize cla= ss
> =C2=A0 =C2=A0 com.sun.jna.Native
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.sun.jna.Pointer.<c= linit>(Pointer.java:42)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.cache.SerializingCache.serialize(Se= rializingCache.java:92)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.cache.SerializingCache.put(Serializ= ingCache.java:154)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.cache.InstrumentingCache.put(Instru= mentingCache.java:63)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.db.ColumnFamilyStore.cacheRow(Colum= nFamilyStore.java:1150)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.db.ColumnFamilyStore.getColumnFamil= y(ColumnFamilyStore.java:1174)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.db.ColumnFamilyStore.getColumnFamil= y(ColumnFamilyStore.java:1131)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.cassandra.db.T= able.getRow(Table.java:378)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.db.SliceFromReadCommand.getRow(Slic= eFromReadCommand.java:61)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.service.StorageProxy$LocalReadRunna= ble.runMayThrow(StorageProxy.java:797)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.service.StorageProxy$DroppableRunna= ble.run(StorageProxy.java:1265)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(T= hreadPoolExecutor.java:886)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 java.util.concurrent.ThreadPoolExecutor$Worker.run(Threa= dPoolExecutor.java:908)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at java.lang.Thread.run(Thre= ad.java:662)
> =C2=A0 =C2=A0 =C2=A0INFO [pool-1-thread-1] 2011-11-02 10:26:46,738 Mem= table.java (line
> =C2=A0 =C2=A0 177) CFS(Keyspace=3D'BigSet', ColumnFamily=3D= 9;theKeys') liveRatio is
> =C2=A0 =C2=A0 18.20062753783684 (just-counted was 16.960966424636872).=
> =C2=A0 =C2=A0 =C2=A0calculation took 408ms for 8169 columns
> =C2=A0 =C2=A0 ERROR [ReadStage:33] 2011-11-02 10:26:56,599
> =C2=A0 =C2=A0 AbstractCassandraDaemon.java (line 133) Fatal exception = in thread
> =C2=A0 =C2=A0 Thread[ReadStage:33,5,main]
> =C2=A0 =C2=A0 java.lang.NoClassDefFoundError: Could not initialize cla= ss
> =C2=A0 =C2=A0 org.apache.cassandra.cache.FreeableMemory
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.cache.SerializingCache.serialize(Se= rializingCache.java:92)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.cache.SerializingCache.put(Serializ= ingCache.java:154)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.cache.InstrumentingCache.put(Instru= mentingCache.java:63)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.db.ColumnFamilyStore.cacheRow(Colum= nFamilyStore.java:1150)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.db.ColumnFamilyStore.getColumnFamil= y(ColumnFamilyStore.java:1174)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.db.ColumnFamilyStore.getColumnFamil= y(ColumnFamilyStore.java:1131)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.cassandra.db.T= able.getRow(Table.java:378)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.db.SliceFromReadCommand.getRow(Slic= eFromReadCommand.java:61)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.service.StorageProxy$LocalReadRunna= ble.runMayThrow(StorageProxy.java:797)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 org.apache.cassandra.service.StorageProxy$DroppableRunna= ble.run(StorageProxy.java:1265)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at
> =C2=A0 =C2=A0 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(T= hreadPoolExecutor.java:886)
>
>


--e89a8f23545db48e6f04b0ed6323--