java.lang.NullPointerException

Apache's JIRA Issue Tracker | Jerry He | 3 years ago
  1. 0

    Reg: SASL authentication

    zookeeper-user | 4 years ago | indirapriyadharshini.thangamani@wipro.com
    java.lang.NullPointerException
  2. 0

    We've been seeing NullPointerException while working on HBase: {code} 14/01/30 22:15:25 INFO zookeeper.ZooKeeper: Client environment:user.dir=/home/biadmin/hbase-trunk 14/01/30 22:15:25 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=hdtest009:2181 sessionTimeout=90000 watcher=null 14/01/30 22:15:25 INFO zookeeper.ClientCnxn: Opening socket connection to server hdtest009/9.30.194.18:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration) 14/01/30 22:15:25 INFO zookeeper.ClientCnxn: Socket connection established to hdtest009/9.30.194.18:2181, initiating session 14/01/30 22:15:25 INFO zookeeper.ClientCnxn: Session establishment complete on server hdtest009/9.30.194.18:2181, sessionid = 0x143986213e67e48, negotiated timeout = 60000 14/01/30 22:15:25 ERROR zookeeper.ClientCnxn: Error while calling watcher java.lang.NullPointerException at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:519) at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:495) {code} The reason is the watcher is null in this part of the code: {code} private void processEvent(Object event) { try { if (event instanceof WatcherSetEventPair) { // each watcher will process the event WatcherSetEventPair pair = (WatcherSetEventPair) event; for (Watcher watcher : pair.watchers) { try { watcher.process(pair.event); } catch (Throwable t) { LOG.error("Error while calling watcher ", t); } } {code}

    Apache's JIRA Issue Tracker | 3 years ago | Jerry He
    java.lang.NullPointerException
  3. 0

    Only 1 of the 3 nodes of the ensemble is started. The server successfully started in readonly ("Read-only server started"). {code:title=client}System.setProperty("readonlymode.enabled", "true"); String cs = "QA-E8WIN11:2181,QA-E8WIN12:2181,QA-E8WIN13:2181"; ZooKeeper zk = new ZooKeeper(cs, 30000, null, true); // wait for connection while (!zk.getState().isConnected()) { Thread.sleep(1000); logger.error(zk.getState()); } zk.getData("/", false, new Stat()); logger.error("DONE");{code} The client code above manages to acquire a connection ("CONNECTEDREADONLY") but the subsequent getData fails with ConnectionLoss: {code:title=client log}2016-10-17 14:37:43 ERROR TestCuratorReadOnly:31 - CONNECTEDREADONLY 2016-10-17 14:39:49 ERROR o.a.z.ClientCnxn:526 - Error while calling watcher java.lang.NullPointerException at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:524) [zookeeper-3.5.2-alpha.jar:3.5.2-alpha--1] at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:499) [zookeeper-3.5.2-alpha.jar:3.5.2-alpha--1] Exception in thread "main" org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for / at org.apache.zookeeper.KeeperException.create(KeeperException.java:99) at org.apache.zookeeper.KeeperException.create(KeeperException.java:51) at org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:1956) at org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:1985) at TestCuratorReadOnly.main(TestCuratorReadOnly.java:33){code} Full server logs are attached, but here are the relevant parts: {code:title=server log} 2016-10-17 14:37:31,375 [myid:1] - INFO [Thread-2:ReadOnlyZooKeeperServer@73] - Read-only server started (...) 2016-10-17 14:37:55,241 [myid:1] - INFO [NIOServerCxnFactory.AcceptThread:/0.0.0.0:2181:NIOServerCnxnFactory$AcceptThread@296] - Accepted socket connection from /10.11.12.4:40800 2016-10-17 14:37:55,250 [myid:1] - INFO [NIOWorkerThread-1:ZooKeeperServer@964] - Client attempting to establish new session at /10.11.12.4:40800 2016-10-17 14:37:55,255 [myid:1] - INFO [ProcessThread(sid:1 cport:-1)::ZooKeeperServer@678] - Established session 0x100024619520000 with negotiated timeout 30000 for client /10.11.12.4:40800 (...) [org.apache.ZooKeeperService:name0=ReplicatedServer_id1,name1=replica.1,name2=ReadOnlyServer,name3=Connections,name4=10.11.12.4,name5=0x100024619520000] 2016-10-17 14:38:26,929 [myid:1] - INFO [ProcessThread(sid:1 cport:-1)::NIOServerCnxn@607] - Closed socket connection for client /10.11.12.4:40800 which had sessionid 0x100024619520000{code} The client and server are using official 3.5.2-alpha. {code:title=zoo.cfg}autopurge.purgeInterval=3 initLimit=10 syncLimit=5 autopurge.snapRetainCount=3 snapCount=10000 minSessionTimeout=5000 maxSessionTimeout=600000 tickTime=2000 admin.commandURL=/commands quorumListenOnAllIPs=true dataDir=C:/workspace/zookeeper-3.5.2-alpha/data admin.serverPort=8080 admin.enableServer=false standaloneEnabled=false dynamicConfigFile=C:/workspace/zookeeper-3.5.2-alpha/conf/zoo.cfg.dynamic.10000046b{code} {code:title=zoo.cfg.dynamic.10000046b}server.1=QA-E8WIN11:2888:3888:participant;0.0.0.0:2181 server.2=QA-E8WIN12:2888:3888:participant;0.0.0.0:2181 server.3=QA-E8WIN13:2888:3888:participant;0.0.0.0:2181{code}

    Apache's JIRA Issue Tracker | 2 months ago | Benjamin Jaton
    java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Reconnect to same Zookeeper server with session id fails

    Stack Overflow | 1 month ago | Karthik
    java.lang.NullPointerException: null
  6. 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 org.apache.zookeeper.ClientCnxn$EventThread.processEvent()
    2. Zookeeper
      ClientCnxn$EventThread.run
      1. org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:519)
      2. org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:495)
      2 frames