Fwd: cassandra 3.0 and datastax java driver 3.0.0 beta1: unresolved user type DoubleType

306 views
Skip to first unread message

Vova Shelgunov

unread,
Nov 10, 2015, 1:37:58 PM11/10/15
to java-dri...@lists.datastax.com
---------- Forwarded message ----------
From: "Vova Shelgunov" <vvs...@gmail.com>
Date: Nov 10, 2015 21:34
Subject: cassandra 3.0 and datastax java driver 3.0.0 beta1: unresolved user type DoubleType
To: <us...@cassandra.apache.org>
Cc:

Hi All,

When I am trying to insert an object of the attached "table_1.png" class I've got the error:

com.datastax.driver.core.exceptions.UnresolvedUserTypeException: Cannot resolve user type keyspace1."org.apache.cassandra.db.marshal.DoubleType"

Could you please suggest the solution?
Thank you

table_1.png
metadata.png
_info.png
geolocation.png

Alexandre Dutra

unread,
Nov 10, 2015, 1:44:09 PM11/10/15
to java-dri...@lists.datastax.com
Hello Vova,

Please avoid cross-posting to more than one list.

I suppose you are testing with a custom build of the driver off of this branch. Beware that this branch hasn't been merged yet and is not released, so you are actually playing with bleeding edge software.

My guess is that you are not using the official Cassandra 3.0.0 version that has been released yesterday. The error message makes me think that your version of Cassandra does not contain the fix for CASSANDRA-10365, which makes it incompatible with the aforementioned java driver branch.

Hope that helps,

Alexandre

--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.
--
Alexandre Dutra
Driver & Tools Engineer @ DataStax

Vova Shelgunov

unread,
Nov 10, 2015, 1:48:25 PM11/10/15
to java-dri...@lists.datastax.com

Hello Alexandre,

Okay, I will try.

Sorry, it is my fail, I am using rc2 because of Debian package unavailability.

Vova Shelgunov

unread,
Nov 10, 2015, 2:30:35 PM11/10/15
to java-dri...@lists.datastax.com
Hello Alexandre,

I have tried cassandra 3.0.0 but I got an old error, maybe this is
related with driver beta version:

InvalidQueryException: Expected 8 or 0 byte long (3)

Alexandre Dutra

unread,
Nov 11, 2015, 5:40:08 AM11/11/15
to java-dri...@lists.datastax.com
Hello Vova,

Can you please post the entire stack trace along with a code snippet that reproduces the error?

Thanks,

Alexandre

Vova Shelgunov

unread,
Nov 11, 2015, 6:02:02 AM11/11/15
to java-dri...@lists.datastax.com
Hi Alexandre,

Stacktrace:

com.datastax.driver.core.exceptions.InvalidQueryException: Expected 8
or 0 byte long (3)
at com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:50)
at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:245)
at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:55)
at com.datastax.driver.mapping.Mapper.save(Mapper.java:240)
....
Caused by: com.datastax.driver.core.exceptions.InvalidQueryException:
Expected 8 or 0 byte long (3)
at com.datastax.driver.core.Responses$Error.asException(Responses.java:124)
at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:180)
at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:186)
at com.datastax.driver.core.RequestHandler.access$2300(RequestHandler.java:44)
at com.datastax.driver.core.RequestHandler$SpeculativeExecution.setFinalResult(RequestHandler.java:754)
at com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:576)
at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:1008)
at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:931)
at com.datastax.shaded.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at com.datastax.shaded.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
at com.datastax.shaded.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
at com.datastax.shaded.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254)
at com.datastax.shaded.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
at com.datastax.shaded.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
at com.datastax.shaded.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at com.datastax.shaded.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
at com.datastax.shaded.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
at com.datastax.shaded.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at com.datastax.shaded.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
at com.datastax.shaded.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
at com.datastax.shaded.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)
at com.datastax.shaded.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
at com.datastax.shaded.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
at com.datastax.shaded.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)
at com.datastax.shaded.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
at com.datastax.shaded.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
at com.datastax.shaded.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
at com.datastax.shaded.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
at com.datastax.shaded.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
at com.datastax.shaded.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)

I can only show the code but it pretty straightforward.
2015-11-11 13-59-41.png

Olivier Michallat

unread,
Nov 13, 2015, 7:04:42 AM11/13/15
to java-dri...@lists.datastax.com
Hi Vova,

Sorry but screenshots aren't a great way to share your code, they're not copy-paste friendly and obfuscating the names (although perfectly understandable from a privacy standpoint) makes things hard to follow. It would be much easier if you could write a separate example that reproduces the issue in the simplest way possible. Having all the code in a self-contained class would be great too, here's a template that you can use: https://gist.github.com/olim7t/57e76a2ce91d011734a0

As Alexandre mentioned, we don't have a stable release that works with Cassandra 3.0.0 GA at this time (that will be Java driver 3.0.0-beta1, which is in the last stages of development). If you're willing to test against a snapshot, you can build the java936 branch from our GitHub repo. You can follow this pull request to find out when it gets merged into the 3.0 branch.

--

Olivier Michallat

Driver & tools engineer, DataStax

Vova Shelgunov

unread,
Nov 13, 2015, 7:07:22 AM11/13/15
to java-dri...@lists.datastax.com

Hi Olivier,

Okay, I will try to reproduce this issue in the separate example and will send it to you.

Vova Shelgunov

unread,
Nov 13, 2015, 8:20:35 AM11/13/15
to java-dri...@lists.datastax.com
Hi Olivier,

Please find the attached archive with project.

Thank you.
cassandra-test.zip

Vova Shelgunov

unread,
Nov 14, 2015, 8:40:10 AM11/14/15
to java-dri...@lists.datastax.com
Hi Olivier,

Did you receive the file?

Thanks.

Olivier Michallat

unread,
Nov 16, 2015, 6:13:57 AM11/16/15
to java-dri...@lists.datastax.com
Hi,

Yes, thanks for taking the time to extract a standalone example.

I can reproduce the issue, it's caused by JAVA-884 which is scheduled for 3.0.0-beta1. I'll work on it today.

--

Olivier Michallat

Driver & tools engineer, DataStax


Vova Shelgunov

unread,
Nov 16, 2015, 12:26:08 PM11/16/15
to java-dri...@lists.datastax.com

Hi Olivier,

Thank you for the quick response

Let me note that everything was OK before cassandra 3.0.

Vova Shelgunov

unread,
Nov 17, 2015, 5:12:35 PM11/17/15
to java-dri...@lists.datastax.com
Hi Olivier,

Did you try my code?

I have got new error:

Exception in thread "main" java.lang.IllegalArgumentException: Cannot
create an instance of custom codec class
com.datastax.driver.core.TypeCodec$PrimitiveLongCodec for field
private java.lang.Long DriverDemo$Metadata.size
at com.datastax.driver.mapping.AnnotationParser.customCodec(AnnotationParser.java:257)
at com.datastax.driver.mapping.ColumnMapper.<init>(ColumnMapper.java:49)
at com.datastax.driver.mapping.ReflectionMapper$LiteralMapper.<init>(ReflectionMapper.java:57)
at com.datastax.driver.mapping.ReflectionMapper$LiteralMapper.<init>(ReflectionMapper.java:51)
at com.datastax.driver.mapping.ReflectionMapper$ReflectionFactory.createColumnMapper(ReflectionMapper.java:100)
at com.datastax.driver.mapping.AnnotationParser.createFieldMappers(AnnotationParser.java:173)
at com.datastax.driver.mapping.AnnotationParser.parseUDT(AnnotationParser.java:164)
at com.datastax.driver.mapping.MappingManager.getUDTCodec(MappingManager.java:173)
at com.datastax.driver.mapping.ReflectionMapper$ReflectionFactory.createColumnMapper(ReflectionMapper.java:98)
at com.datastax.driver.mapping.AnnotationParser.createColumnMappers(AnnotationParser.java:118)
at com.datastax.driver.mapping.AnnotationParser.parseEntity(AnnotationParser.java:109)
at com.datastax.driver.mapping.MappingManager.getMapper(MappingManager.java:155)
at com.datastax.driver.mapping.MappingManager.mapper(MappingManager.java:111)
at DriverDemo.runQueries(DriverDemo.java:54)
at DriverDemo.main(DriverDemo.java:33)
Caused by: java.lang.InstantiationException:
com.datastax.driver.core.TypeCodec$PrimitiveLongCodec
at java.lang.Class.newInstance(Class.java:427)
at com.datastax.driver.mapping.AnnotationParser.customCodec(AnnotationParser.java:254)
Caused by: java.lang.NoSuchMethodException:
com.datastax.driver.core.TypeCodec$PrimitiveLongCodec.<init>()
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.newInstance(Class.java:412)
cassandra-test.zip

Vova Shelgunov

unread,
Nov 18, 2015, 2:44:49 AM11/18/15
to java-dri...@lists.datastax.com
Hi Olivier,

Sorry, this is my fail, I removed codec fron annotation and everything
works now.
Reply all
Reply to author
Forward
0 new messages