Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-2539

Throwing nullpointerException when run the command "config -c" when client port is mentioned as separate and not like new style

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.5.1, 3.5.2
    • 3.5.3, 3.6.0
    • java client
    • None
    • Reviewed

    Description

      Throwing nullpointerException when run the command "config -c" when client port is mentioned as separate and not like new style
      1. Configure the zookeeper to start in cluster mode like below-

      clientPort=2181

      server.1=10.18.101.80:2888:3888
      server.2=10.18.219.50:2888:3888
      server.3=10.18.221.194:2888:3888

      and not like below:-
      server.1=10.18.101.80:2888:3888:participant;2181
      server.2=10.18.219.50:2888:3888:participant;2181
      server.3=10.18.221.194:2888:3888:participant;2181

      2. Start the cluster and one client using >zkCli.sh
      3. execute command "config -c"
      It is throwing nullpointerException:-

      root@BLR1000010865:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin# ./zkCli.sh
      Connecting to localhost:2181
      2016-08-29 21:45:19,558 [myid:] - INFO [main:Environment@109] - Client environment:zookeeper.version=3.5.1-alpha--1, built on 08/18/2016 08:20 GMT
      2016-08-29 21:45:19,561 [myid:] - INFO [main:Environment@109] - Client environment:host.name=BLR1000010865
      2016-08-29 21:45:19,562 [myid:] - INFO [main:Environment@109] - Client environment:java.version=1.7.0_17
      2016-08-29 21:45:19,564 [myid:] - INFO [main:Environment@109] - Client environment:java.vendor=Oracle Corporation
      2016-08-29 21:45:19,564 [myid:] - INFO [main:Environment@109] - Client environment:java.home=/usr/lib/jvm/oracle_jdk7/jre
      2016-08-29 21:45:19,564 [myid:] - INFO [main:Environment@109] - Client environment:java.class.path=/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../build/classes:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../build/lib/*.jar:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../lib/slf4j-log4j12-1.7.5.jar:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../lib/slf4j-api-1.7.5.jar:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../lib/servlet-api-2.5-20081211.jar:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../lib/netty-3.7.0.Final.jar:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../lib/log4j-1.2.16.jar:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../lib/jline-2.11.jar:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../lib/jetty-util-6.1.26.jar:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../lib/jetty-6.1.26.jar:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../lib/javacc.jar:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../lib/jackson-mapper-asl-1.9.11.jar:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../lib/jackson-core-asl-1.9.11.jar:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../lib/commons-cli-1.2.jar:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../lib/ant-eclipse-1.0-jvm1.2.jar:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../zookeeper-3.5.1-alpha.jar:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../src/java/lib/ant-eclipse-1.0-jvm1.2.jar:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin/../conf:
      2016-08-29 21:45:19,564 [myid:] - INFO [main:Environment@109] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
      2016-08-29 21:45:19,564 [myid:] - INFO [main:Environment@109] - Client environment:java.io.tmpdir=/tmp
      2016-08-29 21:45:19,564 [myid:] - INFO [main:Environment@109] - Client environment:java.compiler=<NA>
      2016-08-29 21:45:19,565 [myid:] - INFO [main:Environment@109] - Client environment:os.name=Linux
      2016-08-29 21:45:19,565 [myid:] - INFO [main:Environment@109] - Client environment:os.arch=amd64
      2016-08-29 21:45:19,565 [myid:] - INFO [main:Environment@109] - Client environment:os.version=4.4.0-31-generic
      2016-08-29 21:45:19,565 [myid:] - INFO [main:Environment@109] - Client environment:user.name=root
      2016-08-29 21:45:19,565 [myid:] - INFO [main:Environment@109] - Client environment:user.home=/root
      2016-08-29 21:45:19,565 [myid:] - INFO [main:Environment@109] - Client environment:user.dir=/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin
      2016-08-29 21:45:19,565 [myid:] - INFO [main:Environment@109] - Client environment:os.memory.free=114MB
      2016-08-29 21:45:19,567 [myid:] - INFO [main:Environment@109] - Client environment:os.memory.max=227MB
      2016-08-29 21:45:19,568 [myid:] - INFO [main:Environment@109] - Client environment:os.memory.total=119MB
      2016-08-29 21:45:19,570 [myid:] - INFO [main:ZooKeeper@716] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@149ee0f1
      Welcome to ZooKeeper!
      2016-08-29 21:45:19,596 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1138] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
      2016-08-29 21:45:19,603 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@980] - Socket connection established, initiating session, client: /127.0.0.1:43574, server: localhost/127.0.0.1:2181
      JLine support is enabled
      2016-08-29 21:45:19,630 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1400] - Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x20044a0c51d0000, negotiated timeout = 30000

      WATCHER::

      WatchedEvent state:SyncConnected type:None path:null
      [zk: localhost:2181(CONNECTED) 0]
      [zk: localhost:2181(CONNECTED) 0] config -c
      Exception in thread "main" java.lang.NullPointerException
      at org.apache.zookeeper.server.util.ConfigUtils.getClientConfigStr(ConfigUtils.java:56)
      at org.apache.zookeeper.cli.GetConfigCommand.exec(GetConfigCommand.java:64)
      at org.apache.zookeeper.ZooKeeperMain.processZKCmd(ZooKeeperMain.java:674)
      at org.apache.zookeeper.ZooKeeperMain.processCmd(ZooKeeperMain.java:577)
      at org.apache.zookeeper.ZooKeeperMain.executeLine(ZooKeeperMain.java:360)
      at org.apache.zookeeper.ZooKeeperMain.run(ZooKeeperMain.java:320)
      at org.apache.zookeeper.ZooKeeperMain.main(ZooKeeperMain.java:280)
      root@BLR1000010865:/home/Rakesh/Zookeeper/18_Aug/cluster/zookeeper-3.5.1-alpha/bin#

      Attachments

        1. ConfigUtils.java.patch
          0.6 kB
          Rakesh Kumar Singh
        2. ConfigUtils.java.patch
          0.7 kB
          Rakesh Kumar Singh
        3. ZOOKEEPER-2539.patch
          2 kB
          Patrick D. Hunt

        Activity

          People

            rakeshsingh Rakesh Kumar Singh
            rakeshsingh Rakesh Kumar Singh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: