java.lang.NullPointerException

DataStax JIRA | Yohan Liyanage | 10 months ago
  1. 0

    We are trying to access Cassandra from a Spark application directly using the Cassandra Java Driver (not the spark-connector). We see the following exception being logged in our worker nodes intermittently. Everything looks to be working fine first, but after some time, we see this exception getting logged. After this exception is logged, the connection fails and soon after we get com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (no host was tried). We are using Datastax driver 2.1.7.1 against Cassandra 2.1.11 (Datastax Community). Stack trace and trace log is as follows: 2016-01-26 17:54:01.875 DEBUG - [r2-nio-worker-3] [5ca87f65-2ddc-4a45-8d01-22811dd1b6d1] com.datastax.driver.core.Connection : Connection[/192.172.2.51:9042-1, inFlight=0, closed=false] connection error java.lang.NullPointerException at com.datastax.driver.core.ProtocolOptions.getProtocolVersionEnum(ProtocolOptions.java:178) at com.datastax.driver.core.QueryLogger.protocolVersion(QueryLogger.java:753) at com.datastax.driver.core.QueryLogger.parameterValueAsString(QueryLogger.java:738) at com.datastax.driver.core.QueryLogger.appendParameters(QueryLogger.java:709) at com.datastax.driver.core.QueryLogger.logQuery(QueryLogger.java:647) at com.datastax.driver.core.QueryLogger.maybeLogNormalQuery(QueryLogger.java:631) at com.datastax.driver.core.QueryLogger$ConstantThresholdQueryLogger.maybeLogNormalOrSlowQuery(QueryLogger.java:278) at com.datastax.driver.core.QueryLogger.update(QueryLogger.java:620) at com.datastax.driver.core.Cluster$Manager.reportLatency(Cluster.java:1422) at com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:607) at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:991) at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:913) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe.epollInReady(EpollSocketChannel.java:722) at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:326) at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:264) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) at java.lang.Thread.run(Thread.java:745) 2016-01-26 17:54:01.876 DEBUG - [r2-nio-worker-3] [5ca87f65-2ddc-4a45-8d01-22811dd1b6d1] com.datastax.driver.core.Connection : Defuncting connection to /192.172.2.51:9042 com.datastax.driver.core.TransportException: [/192.172.2.51:9042] Unexpected exception triggered (java.lang.NullPointerException) at com.datastax.driver.core.Connection$Dispatcher.exceptionCaught(Connection.java:1028) at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:271) at io.netty.channel.AbstractChannelHandlerContext.notifyHandlerException(AbstractChannelHandlerContext.java:768) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:335) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe.epollInReady(EpollSocketChannel.java:722) at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:326) at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:264) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException at com.datastax.driver.core.ProtocolOptions.getProtocolVersionEnum(ProtocolOptions.java:178) at com.datastax.driver.core.QueryLogger.protocolVersion(QueryLogger.java:753) at com.datastax.driver.core.QueryLogger.parameterValueAsString(QueryLogger.java:738) at com.datastax.driver.core.QueryLogger.appendParameters(QueryLogger.java:709) at com.datastax.driver.core.QueryLogger.logQuery(QueryLogger.java:647) at com.datastax.driver.core.QueryLogger.maybeLogNormalQuery(QueryLogger.java:631) at com.datastax.driver.core.QueryLogger$ConstantThresholdQueryLogger.maybeLogNormalOrSlowQuery(QueryLogger.java:278) at com.datastax.driver.core.QueryLogger.update(QueryLogger.java:620) at com.datastax.driver.core.Cluster$Manager.reportLatency(Cluster.java:1422) at com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:607) at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:991) at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:913) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) ... 16 more

    DataStax JIRA | 10 months ago | Yohan Liyanage
    java.lang.NullPointerException
  2. 0

    We are trying to access Cassandra from a Spark application directly using the Cassandra Java Driver (not the spark-connector). We see the following exception being logged in our worker nodes intermittently. Everything looks to be working fine first, but after some time, we see this exception getting logged. After this exception is logged, the connection fails and soon after we get com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (no host was tried). We are using Datastax driver 2.1.7.1 against Cassandra 2.1.11 (Datastax Community). Stack trace and trace log is as follows: 2016-01-26 17:54:01.875 DEBUG - [r2-nio-worker-3] [5ca87f65-2ddc-4a45-8d01-22811dd1b6d1] com.datastax.driver.core.Connection : Connection[/192.172.2.51:9042-1, inFlight=0, closed=false] connection error java.lang.NullPointerException at com.datastax.driver.core.ProtocolOptions.getProtocolVersionEnum(ProtocolOptions.java:178) at com.datastax.driver.core.QueryLogger.protocolVersion(QueryLogger.java:753) at com.datastax.driver.core.QueryLogger.parameterValueAsString(QueryLogger.java:738) at com.datastax.driver.core.QueryLogger.appendParameters(QueryLogger.java:709) at com.datastax.driver.core.QueryLogger.logQuery(QueryLogger.java:647) at com.datastax.driver.core.QueryLogger.maybeLogNormalQuery(QueryLogger.java:631) at com.datastax.driver.core.QueryLogger$ConstantThresholdQueryLogger.maybeLogNormalOrSlowQuery(QueryLogger.java:278) at com.datastax.driver.core.QueryLogger.update(QueryLogger.java:620) at com.datastax.driver.core.Cluster$Manager.reportLatency(Cluster.java:1422) at com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:607) at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:991) at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:913) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe.epollInReady(EpollSocketChannel.java:722) at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:326) at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:264) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) at java.lang.Thread.run(Thread.java:745) 2016-01-26 17:54:01.876 DEBUG - [r2-nio-worker-3] [5ca87f65-2ddc-4a45-8d01-22811dd1b6d1] com.datastax.driver.core.Connection : Defuncting connection to /192.172.2.51:9042 com.datastax.driver.core.TransportException: [/192.172.2.51:9042] Unexpected exception triggered (java.lang.NullPointerException) at com.datastax.driver.core.Connection$Dispatcher.exceptionCaught(Connection.java:1028) at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:271) at io.netty.channel.AbstractChannelHandlerContext.notifyHandlerException(AbstractChannelHandlerContext.java:768) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:335) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe.epollInReady(EpollSocketChannel.java:722) at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:326) at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:264) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException at com.datastax.driver.core.ProtocolOptions.getProtocolVersionEnum(ProtocolOptions.java:178) at com.datastax.driver.core.QueryLogger.protocolVersion(QueryLogger.java:753) at com.datastax.driver.core.QueryLogger.parameterValueAsString(QueryLogger.java:738) at com.datastax.driver.core.QueryLogger.appendParameters(QueryLogger.java:709) at com.datastax.driver.core.QueryLogger.logQuery(QueryLogger.java:647) at com.datastax.driver.core.QueryLogger.maybeLogNormalQuery(QueryLogger.java:631) at com.datastax.driver.core.QueryLogger$ConstantThresholdQueryLogger.maybeLogNormalOrSlowQuery(QueryLogger.java:278) at com.datastax.driver.core.QueryLogger.update(QueryLogger.java:620) at com.datastax.driver.core.Cluster$Manager.reportLatency(Cluster.java:1422) at com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:607) at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:991) at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:913) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) ... 16 more

    DataStax JIRA | 10 months ago | Yohan Liyanage
    java.lang.NullPointerException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.datastax.driver.core.ProtocolOptions.getProtocolVersionEnum()
    2. DataStax Java Driver for Apache Cassandra - Core
      Connection$Dispatcher.channelRead0
      1. com.datastax.driver.core.ProtocolOptions.getProtocolVersionEnum(ProtocolOptions.java:178)
      2. com.datastax.driver.core.QueryLogger.protocolVersion(QueryLogger.java:753)
      3. com.datastax.driver.core.QueryLogger.parameterValueAsString(QueryLogger.java:738)
      4. com.datastax.driver.core.QueryLogger.appendParameters(QueryLogger.java:709)
      5. com.datastax.driver.core.QueryLogger.logQuery(QueryLogger.java:647)
      6. com.datastax.driver.core.QueryLogger.maybeLogNormalQuery(QueryLogger.java:631)
      7. com.datastax.driver.core.QueryLogger$ConstantThresholdQueryLogger.maybeLogNormalOrSlowQuery(QueryLogger.java:278)
      8. com.datastax.driver.core.QueryLogger.update(QueryLogger.java:620)
      9. com.datastax.driver.core.Cluster$Manager.reportLatency(Cluster.java:1422)
      10. com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:607)
      11. com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:991)
      12. com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:913)
      12 frames
    3. Netty
      SingleThreadEventExecutor$2.run
      1. io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
      2. io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
      3. io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
      4. io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254)
      5. io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
      6. io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
      7. io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
      8. io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
      9. io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
      10. io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)
      11. io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
      12. io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
      13. io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787)
      14. io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe.epollInReady(EpollSocketChannel.java:722)
      15. io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:326)
      16. io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:264)
      17. io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
      17 frames
    4. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:745)
      1 frame