com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [timestamp <-> java.lang.Long]

Stack Overflow | Knows Not Much | 4 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Codec not found for requested operation: [timestamp <-> java.lang.Long]

    Stack Overflow | 4 months ago | Knows Not Much
    com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [timestamp <-> java.lang.Long]
  2. 0

    Seeing this error: com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [timestamp <-> com.datastax.driver.core.LocalDate] From my pom.xml: <dependency> <groupId>com.datastax.cassandra</groupId> <artifactId>cassandra-driver-core</artifactId> <version>3.0.0</version> </dependency> <dependency> <groupId>com.datastax.cassandra</groupId> <artifactId>cassandra-driver-mapping</artifactId> <version>3.0.0</version> </dependency> against Cassamdra 3.5. Here's a stacktrace: com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [timestamp <-> com.datastax.driver.core.LocalDate] at com.datastax.driver.core.CodecRegistry.notFound(CodecRegistry.java:679) at com.datastax.driver.core.CodecRegistry.createCodec(CodecRegistry.java:526) at com.datastax.driver.core.CodecRegistry.findCodec(CodecRegistry.java:506) at com.datastax.driver.core.CodecRegistry.access$200(CodecRegistry.java:140) at com.datastax.driver.core.CodecRegistry$TypeCodecCacheLoader.load(CodecRegistry.java:211) at com.datastax.driver.core.CodecRegistry$TypeCodecCacheLoader.load(CodecRegistry.java:208) at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) at com.google.common.cache.LocalCache.get(LocalCache.java:3934) at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) at com.datastax.driver.core.CodecRegistry.lookupCodec(CodecRegistry.java:480) at com.datastax.driver.core.CodecRegistry.codecFor(CodecRegistry.java:448) at com.datastax.driver.core.CodecRegistry.codecFor(CodecRegistry.java:430) at com.datastax.driver.core.AbstractGettableByIndexData.codecFor(AbstractGettableByIndexData.java:69) at com.datastax.driver.core.AbstractGettableByIndexData.getDate(AbstractGettableByIndexData.java:174) at com.datastax.driver.core.AbstractGettableData.getDate(AbstractGettableData.java:26) at com.datastax.driver.core.AbstractGettableData.getDate(AbstractGettableData.java:111) at org.makeyourcase.persistence.commands.arena.ListArenasCommand.execute(ListArenasCommand.java:44) at org.makeyourcase.persistence.executors.CassandraExecutor.execute(CassandraExecutor.java:59) at org.makeyourcase.arena.ArenaService.buildArenaList(ArenaService.java:153) at org.makeyourcase.arena.ArenaService.listArenas(ArenaService.java:94) at org.makeyourcase.arena.ArenaService$$FastClassBySpringCGLIB$$8bce1188.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) at org.makeyourcase.arena.ArenaService$$EnhancerBySpringCGLIB$$bf9cef0d.listArenas(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185) at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409) at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558) at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:927) at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:875) at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:829) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) This is the line of code. Row is a com.datastax.driver.core.Row. LocalDate created_on = row.getDate("created_on");

    DataStax JIRA | 10 months ago | Don Branson
    com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [timestamp <-> com.datastax.driver.core.LocalDate]
  3. 0

    Seeing this error: com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [timestamp <-> com.datastax.driver.core.LocalDate] From my pom.xml: <dependency> <groupId>com.datastax.cassandra</groupId> <artifactId>cassandra-driver-core</artifactId> <version>3.0.0</version> </dependency> <dependency> <groupId>com.datastax.cassandra</groupId> <artifactId>cassandra-driver-mapping</artifactId> <version>3.0.0</version> </dependency> against Cassamdra 3.5. Here's a stacktrace: com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [timestamp <-> com.datastax.driver.core.LocalDate] at com.datastax.driver.core.CodecRegistry.notFound(CodecRegistry.java:679) at com.datastax.driver.core.CodecRegistry.createCodec(CodecRegistry.java:526) at com.datastax.driver.core.CodecRegistry.findCodec(CodecRegistry.java:506) at com.datastax.driver.core.CodecRegistry.access$200(CodecRegistry.java:140) at com.datastax.driver.core.CodecRegistry$TypeCodecCacheLoader.load(CodecRegistry.java:211) at com.datastax.driver.core.CodecRegistry$TypeCodecCacheLoader.load(CodecRegistry.java:208) at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) at com.google.common.cache.LocalCache.get(LocalCache.java:3934) at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) at com.datastax.driver.core.CodecRegistry.lookupCodec(CodecRegistry.java:480) at com.datastax.driver.core.CodecRegistry.codecFor(CodecRegistry.java:448) at com.datastax.driver.core.CodecRegistry.codecFor(CodecRegistry.java:430) at com.datastax.driver.core.AbstractGettableByIndexData.codecFor(AbstractGettableByIndexData.java:69) at com.datastax.driver.core.AbstractGettableByIndexData.getDate(AbstractGettableByIndexData.java:174) at com.datastax.driver.core.AbstractGettableData.getDate(AbstractGettableData.java:26) at com.datastax.driver.core.AbstractGettableData.getDate(AbstractGettableData.java:111) at org.makeyourcase.persistence.commands.arena.ListArenasCommand.execute(ListArenasCommand.java:44) at org.makeyourcase.persistence.executors.CassandraExecutor.execute(CassandraExecutor.java:59) at org.makeyourcase.arena.ArenaService.buildArenaList(ArenaService.java:153) at org.makeyourcase.arena.ArenaService.listArenas(ArenaService.java:94) at org.makeyourcase.arena.ArenaService$$FastClassBySpringCGLIB$$8bce1188.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) at org.makeyourcase.arena.ArenaService$$EnhancerBySpringCGLIB$$bf9cef0d.listArenas(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185) at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409) at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558) at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:927) at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:875) at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:829) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) This is the line of code. Row is a com.datastax.driver.core.Row. LocalDate created_on = row.getDate("created_on");

    DataStax JIRA | 10 months ago | Don Branson
    com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [timestamp <-> com.datastax.driver.core.LocalDate]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I tried to insert a image as blob data as bytes into blob field in a cassandra table. It is showing below errors after executing the program. Program: {code} package Pkg_Upload; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.nio.ByteBuffer; import com.datastax.driver.core.BoundStatement; import com.datastax.driver.core.Cluster; import com.datastax.driver.core.PreparedStatement; import com.datastax.driver.core.Session; import com.datastax.driver.core.utils.Bytes; public class Img_Upload4 { public static void main(String[] args) throws IOException { Cluster cluster = Cluster.builder().addContactPoint("localhost") .build(); Session session = cluster.connect("san_db"); session.getLoggedKeyspace(); session = cluster.connect("san_db"); session.getLoggedKeyspace(); File file = new File("C:\\Desert.jpg"); FileInputStream fis=new FileInputStream(file); ByteArrayOutputStream bos = new ByteArrayOutputStream(); byte[] buf = new byte[fis.available()+1]; for (int readNum; (readNum = fis.read(buf)) != -1;) { //Writes to this byte array output stream bos.write(buf, 0, readNum); System.out.println("read " + readNum + " bytes,"); } // int length=buf.length; fis.read(buf); //ByteBuffer buffer =ByteBuffer.wrap(b); PreparedStatement ps = session.prepare("insert into UserImages(name,photo) values(?,?)"); BoundStatement bs = ps.bind() .setString(1, "Radha") .setBytes(2,ByteBuffer.wrap(buf)); session.execute(bs); } } {code} Errors I am getting: {code} Exception in thread "main" com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [blob <-> java.lang.String] at com.datastax.driver.core.CodecRegistry.notFound(CodecRegistry.java:679) at com.datastax.driver.core.CodecRegistry.createCodec(CodecRegistry.java:526) at com.datastax.driver.core.CodecRegistry.findCodec(CodecRegistry.java:506) at com.datastax.driver.core.CodecRegistry.access$200(CodecRegistry.java:140) at com.datastax.driver.core.CodecRegistry$TypeCodecCacheLoader.load(CodecRegistry.java:211) at com.datastax.driver.core.CodecRegistry$TypeCodecCacheLoader.load(CodecRegistry.java:208) at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3542) at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2323) at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2286) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2201) at com.google.common.cache.LocalCache.get(LocalCache.java:3953) at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3957) at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4875) at com.datastax.driver.core.CodecRegistry.lookupCodec(CodecRegistry.java:480) at com.datastax.driver.core.CodecRegistry.codecFor(CodecRegistry.java:448) at com.datastax.driver.core.CodecRegistry.codecFor(CodecRegistry.java:430) at com.datastax.driver.core.AbstractGettableByIndexData.codecFor(AbstractGettableByIndexData.java:69) at com.datastax.driver.core.AbstractData.setString(AbstractData.java:249) at com.datastax.driver.core.BoundStatement.setString(BoundStatement.java:446) at Pkg_Upload.Img_Upload4.main(Img_Upload4.java:50) {code} Can any one please suggest a solution?

    DataStax JIRA | 4 months ago | sanjeev
    com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [blob <-> java.lang.String]
  6. 0

    Regression on Datastax 3.0.0 driver

    GitHub | 10 months ago | jalkanen
    com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [timestamp <-> com.datastax.driver.core.LocalDate]

    Root Cause Analysis

    1. com.datastax.driver.core.exceptions.CodecNotFoundException

      Codec not found for requested operation: [timestamp <-> java.lang.Long]

      at com.datastax.driver.core.CodecRegistry.notFound()
    2. DataStax Java Driver for Apache Cassandra - Core
      CodecRegistry$TypeCodecCacheLoader.load
      1. com.datastax.driver.core.CodecRegistry.notFound(CodecRegistry.java:679)
      2. com.datastax.driver.core.CodecRegistry.createCodec(CodecRegistry.java:526)
      3. com.datastax.driver.core.CodecRegistry.findCodec(CodecRegistry.java:506)
      4. com.datastax.driver.core.CodecRegistry.access$200(CodecRegistry.java:140)
      5. com.datastax.driver.core.CodecRegistry$TypeCodecCacheLoader.load(CodecRegistry.java:211)
      6. com.datastax.driver.core.CodecRegistry$TypeCodecCacheLoader.load(CodecRegistry.java:208)
      6 frames
    3. Guava
      LocalCache$LoadingValueReference.loadFuture
      1. com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3542)
      1 frame