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 20A41DBA2 for ; Wed, 12 Sep 2012 22:28:30 +0000 (UTC) Received: (qmail 41714 invoked by uid 500); 12 Sep 2012 22:28:27 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 41689 invoked by uid 500); 12 Sep 2012 22:28:27 -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 41681 invoked by uid 99); 12 Sep 2012 22:28:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Sep 2012 22:28:27 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.113.200.5] (HELO homiemail-a94.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Sep 2012 22:28:22 +0000 Received: from homiemail-a94.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a94.g.dreamhost.com (Postfix) with ESMTP id 84D3538A06F for ; Wed, 12 Sep 2012 15:28:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=thelastpickle.com; h=from :content-type:message-id:mime-version:subject:date:references:to :in-reply-to; s=thelastpickle.com; bh=ZgAfky0wTNzzmWkD7thzJHmraD s=; b=H0CsHm26XyImn8iFuZtytDgX3E3nIQl1oIwgCggrijMpjpDe2NA8DTwHKV VNU/U7p3rDQ2ZAibIDZunAE/Yoe7OCXhbG+VJ7qR9wbXAqBY7XIo5j1jlEWelizW cJ479MMyNpiwjBnhK/NyqmLgc8sO/bsp6T0G0UsdcZlqp9vVI= Received: from [192.168.2.77] (unknown [116.90.132.105]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: aaron@thelastpickle.com) by homiemail-a94.g.dreamhost.com (Postfix) with ESMTPSA id DA5DE38A05B for ; Wed, 12 Sep 2012 15:28:00 -0700 (PDT) From: aaron morton Content-Type: multipart/alternative; boundary="Apple-Mail=_291ED788-A126-42C3-BBB1-CE3A730E6354" Message-Id: <227F4A0B-55AD-4315-8C19-CCE071904670@thelastpickle.com> Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) Subject: Re: Astyanax InstantiationException when accessing ColumnList Date: Thu, 13 Sep 2012 10:28:00 +1200 References: To: user@cassandra.apache.org In-Reply-To: X-Mailer: Apple Mail (2.1486) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_291ED788-A126-42C3-BBB1-CE3A730E6354 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Was there more to the error message ? Looks likes there should be a = caused by exception there = https://github.com/Netflix/astyanax/blob/master/src/main/java/com/netflix/= astyanax/serializers/AnnotatedCompositeSerializer.java#L114 The InstationError is being raised when it tries to create an instance = of the column type=20 = https://github.com/Netflix/astyanax/blob/master/src/main/java/com/netflix/= astyanax/serializers/AnnotatedCompositeSerializer.java#L166 I would check everything is in the class path and create an issue on = https://github.com/Netflix/astyanax/issues if you get stuck.=20 Cheers ----------------- Aaron Morton Freelance Developer @aaronmorton http://www.thelastpickle.com On 12/09/2012, at 2:04 PM, Ran User wrote: > Oops, forgot to mention Cassandra version - 1.1.4 >=20 > On Tue, Sep 11, 2012 at 5:54 AM, Ran User wrote: > Stuck for hours on this one, thanks in advance! > =20 > - Scala 2.9.2 > - Astyanax 1.0.6 (also tried 1.0.5) > - Using CompositeRowKey, CompositeColumnName > - No problem inserting into Cassandra > - Can read a row, ColumnList.size() returns correct count however any = attempt to access ColumnList (i.e. iterate, access iterate ColumnList, = getColumnByIndex(), getColumnByName(), etc) will throw the following = exception: > Exception: >=20 > java.lang.RuntimeException: java.lang.InstantiationException >=20 > relevant stack trace: >=20 > java.lang.RuntimeException: java.lang.InstantiationException: = shops.integration.db.scalaquery.ReportingDao$MetricsLogFileCompositeColumn= > at = com.netflix.astyanax.serializers.AnnotatedCompositeSerializer.fromByteBuff= er(AnnotatedCompositeSerializer.java:136) > at = com.netflix.astyanax.serializers.AbstractSerializer.fromBytes(AbstractSeri= alizer.java:40) > at = com.netflix.astyanax.thrift.model.ThriftColumnOrSuperColumnListImpl.constr= uctMap(ThriftColumnOrSuperColumnListImpl.java:201) > at = com.netflix.astyanax.thrift.model.ThriftColumnOrSuperColumnListImpl.getCol= umn(ThriftColumnOrSuperColumnListImpl.java:189) > at = com.netflix.astyanax.thrift.model.ThriftColumnOrSuperColumnListImpl.getCol= umnByName(ThriftColumnOrSuperColumnListImpl.java:103) >=20 > Relevant sample code: >=20 > class TestCompositeColumn(@(Component @field) var logFileId: Long, = @(Component @field) var dt: String, @(Component @field) var dk: String) = extends Ordered[TestCompositeColumn] { > def this() =3D this(0l, "", "") > //equals, hashCode, compare all implemented > } >=20 > I've also tried this variation on the class: >=20 > class TestCompositeColumn(idIn: Long, key1In: String, key2In: = String) extends Ordered[TestCompositeColumn] { > @Component(ordinal =3D 0) var id: Long =3D idIn > @Component(ordinal =3D 1) var key1: String =3D key1In > @Component(ordinal =3D 2) var key2: String =3D key2In > =20 > def this() =3D this(0, null, null) > //equals, hashCode, compare all implemented > } >=20 > val TEST_COLUMN_FAMILY =3D new ColumnFamily[TestRowKey, = TestCompositeColumn]( > "test_column_family", > new = AnnotatedCompositeSerializer[TestRowKey](classOf[TestRowKey]), > new = AnnotatedCompositeSerializer[TestCompositeColumn](classOf[TestCompositeCol= umn]), > BytesArraySerializer.get()); > =20 > var columnList =3D keyspace.prepareQuery(TEST_COLUMN_FAMILY) > .getKey(TestRowKey(1l, 2012090100)) > .execute().getResult() > =20 > // OK - will return 6 for example, also verified via cassandra-cli > println(columnList.size()) =20 > =20 > // ERROR - will throw exception above. Iterating, or any type of = access will also throw same exception > println(columnList.getColumnByIndex(0).getStringValue())=20 > =20 > Thank you!!! > =20 >=20 --Apple-Mail=_291ED788-A126-42C3-BBB1-CE3A730E6354 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=iso-8859-1 Was = there more to the error message ? Looks likes there should be a caused = by exception there https= ://github.com/Netflix/astyanax/blob/master/src/main/java/com/netflix/astya= nax/serializers/AnnotatedCompositeSerializer.java#L114

<= div>The InstationError is being raised when it tries to create an = instance of the column type 

<= /div>
I would check everything is in the class path and create an = issue on https://github.com/Net= flix/astyanax/issues if you get = stuck. 

Cheers


=

http://www.thelastpickle.com

On 12/09/2012, at 2:04 PM, Ran User <ranuser99@gmail.com> = wrote:

Oops, forgot to mention Cassandra version - = 1.1.4

On Tue, Sep 11, 2012 at 5:54 AM, = Ran User <ranuser99@gmail.com> wrote:
Stuck for = hours on this one, thanks in advance!
 
-  Scala 2.9.2
- Astyanax 1.0.6 (also = tried 1.0.5)
- Using CompositeRowKey, CompositeColumnName
- No = problem inserting into Cassandra
- Can read a row, ColumnList.size() = returns correct count however any attempt to access ColumnList (i.e. = iterate, access iterate ColumnList, getColumnByIndex(), = getColumnByName(), etc) will throw the following = exception:

Exception:

java.lang.RuntimeException: = java.lang.InstantiationException

relevant stack = trace:

java.lang.RuntimeException: = java.lang.InstantiationException: = shops.integration.db.scalaquery.ReportingDao$MetricsLogFileCompositeColumn=
            at = com.netflix.astyanax.serializers.AnnotatedCompositeSerializer.fromByteBuff= er(AnnotatedCompositeSerializer.java:136)
     = ;       at = com.netflix.astyanax.serializers.AbstractSerializer.fromBytes(AbstractSeri= alizer.java:40)
            at = com.netflix.astyanax.thrift.model.ThriftColumnOrSuperColumnListImpl.constr= uctMap(ThriftColumnOrSuperColumnListImpl.java:201)
   &n= bsp;        at = com.netflix.astyanax.thrift.model.ThriftColumnOrSuperColumnListImpl.getCol= umn(ThriftColumnOrSuperColumnListImpl.java:189)
            at = com.netflix.astyanax.thrift.model.ThriftColumnOrSuperColumnListImpl.getCol= umnByName(ThriftColumnOrSuperColumnListImpl.java:103)

Relevant = sample code:

class TestCompositeColumn(@(Component @field) var = logFileId: Long, @(Component @field) var dt: String, @(Component @field) = var dk: String) extends Ordered[TestCompositeColumn] {
        def this() =3D this(0l, "", = "")
        //equals, hashCode, = compare all implemented
    }

I've also tried = this variation on the class:

    class = TestCompositeColumn(idIn: Long, key1In: String, key2In: String) extends = Ordered[TestCompositeColumn] {
        @Component(ordinal =3D 0) var = id: Long =3D idIn
        = @Component(ordinal =3D 1) var key1: String =3D = key1In
        @Component(ordinal = =3D 2) var key2: String =3D key2In
    =
        def this() =3D this(0, = null, null)
        //equals, hashCode, compare = all implemented
    }

val TEST_COLUMN_FAMILY =3D= new ColumnFamily[TestRowKey, = TestCompositeColumn](
        = "test_column_family",
        new = AnnotatedCompositeSerializer[TestRowKey](classOf[TestRowKey]),
        new = AnnotatedCompositeSerializer[TestCompositeColumn](classOf[TestCompositeCol= umn]),
        = BytesArraySerializer.get());
 
var columnList =3D= = keyspace.prepareQuery(TEST_COLUMN_FAMILY)
     = ;   .getKey(TestRowKey(1l, 2012090100))
        = .execute().getResult()
    
// OK - will = return 6 for example, also verified via = cassandra-cli
println(columnList.size())     &= nbsp;   
        =
// ERROR - will throw exception above.  Iterating, or any type = of access will also throw same exception
println(columnList.getColumnByIndex(0).getStringValue())  =
 
Thank you!!!
 


= --Apple-Mail=_291ED788-A126-42C3-BBB1-CE3A730E6354--