no serializer for BigDecimal when doing composite #101

Closed
deanhiller opened this Issue Aug 2, 2012 · 1 comment

Projects

None yet

2 participants

@deanhiller

I think the work around is to tell cassandra it is Decimal, but then do byte[] in astyanax but I am getting a very odd exception that says can't convert [B to [B.

stack trace is below(I am stil working on figuring this out)...

java.lang.RuntimeException: java.lang.IllegalArgumentException: Can not set [B field com.alvazan.orm.layer3.spi.db.cassandra.BigDecimalComposite.value to [B
at com.netflix.astyanax.serializers.AnnotatedCompositeSerializer.toByteBuffer(AnnotatedCompositeSerializer.java:107)
at com.netflix.astyanax.thrift.ThriftColumnFamilyMutationImpl.putEmptyColumn(ThriftColumnFamilyMutationImpl.java:79)
at com.netflix.astyanax.AbstractColumnListMutation.putEmptyColumn(AbstractColumnListMutation.java:138)
at com.alvazan.orm.layer3.spi.db.cassandra.CassandraSession.persistIndex(CassandraSession.java:427)
at com.alvazan.orm.layer3.spi.db.cassandra.CassandraSession.sendChangesImpl(CassandraSession.java:276)
at com.alvazan.orm.layer3.spi.db.cassandra.CassandraSession.sendChanges(CassandraSession.java:263)
at com.alvazan.orm.layer2.nosql.cache.NoSqlWriteCacheImpl.flush(NoSqlWriteCacheImpl.java:93)
at com.alvazan.orm.layer2.nosql.cache.NoSqlReadCacheImpl.flush(NoSqlReadCacheImpl.java:57)
at com.alvazan.orm.layer1.base.BaseEntityManagerImpl.flush(BaseEntityManagerImpl.java:154)
at com.alvazan.test.TestIndexesNew.testFloatKey(TestIndexesNew.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.IllegalArgumentException: Can not set [B field com.alvazan.orm.layer3.spi.db.cassandra.BigDecimalComposite.value to [B
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:164)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:168)
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:55)
at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:36)
at java.lang.reflect.Field.get(Field.java:372)
at com.netflix.astyanax.serializers.AnnotatedCompositeSerializer$ComponentSerializer.serialize(AnnotatedCompositeSerializer.java:52)
at com.netflix.astyanax.serializers.AnnotatedCompositeSerializer.toByteBuffer(AnnotatedCompositeSerializer.java:96)
... 35 more

Member
elandau commented Jan 23, 2013

Sorry for the late response. This will be fixed with 1.56.24

@elandau elandau closed this Jan 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment