Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

peteisace avatar image
peteisace asked Erick Ramirez answered

CodecNotFoundException daterange despite not using it...

OK i'm really ashamed even to be asking this, but I'm stumped.

I did some fairly major refactoring of a working API. New bits I added were moving multiple queries to a single 'IN' query.

However, now the application throws a CodecNotFoundException with Java Date and DataStax daterange when it tries to load the DseTypeCodecsResgistrar way down the callstack, but basically when I call CqlSession.builder().buildAsync() for the first time.

public static void registerDseCodecs(MutableCodecRegistry registry) {
  registry.register(DseTypeCodecs.DATE_RANGE);

But I don't get it... Why would the very first instantiation of the CqlSession cause the exception to be thrown, and that's after changing code that hasn't even been called yet?! I got to the level of desperation of just calling a very simple query on Startup, that doesn't use any dates of any kind, and still, it is this first call to CqlSession that throws the exception. It's bizarre.

I've obviously made a schoolboy error, and i have no idea what it is, or why it would affect the very first call to CqlSession. I didn't change the schema, I didn't change the config, I didn't change the server, I didn't change anything about the client connectivity, literally moved a query that hasn't been called yet in the call stack from multiple queries, to a single query. But for the life of me I can't get it to return including a mass undo effort (buffer runs out of space so it's not a total undo).

Apologies for even asking this, I'm sure it's something beyond daft, but I can't see it right now.

java driver
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

Don't be hard on yourself. It's happened to all of us. :)

It would be really help us diagnose the problem if you're able to updated your original question and post the following:

  • full error/exception message + full stack trace
  • minimal code snippet to possibly replicate the issue
  • a sample of the updated query
  • table schema (feel free to obfuscate as necessary)
  • Java driver version
  • Cassandra version

Is it possible at all that you made a change somewhere else for which the codec isn't registered?

In any case, I'll pass on the details you provide to the devs here at DataStax. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.