Fixing the java.nio.channels.CancelledKeyException Exception in Zookeeper startup

Document created by rsingh on Feb 13, 2016
Version 1Show Document
  • View in full screen mode

Author: Rajkumar Singh

 

Original Publication Date: April 26, 2015

 

 

Env:

M3/M5/M7
Zookeeper-3.4.5

 

Symptom:

User will see the zookeeper logs containing the gnu.java* strings

java.nio.channels.CancelledKeyException
  at gnu.java.nio.SelectionKeyImpl.readyOps(libgcj.so.10)
  at org.apache.zookeeper.server.NIOServerCnxn$Factory.run(NIOServerCnxn.java:241)
2013-03-27 16:07:23,051 - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:5181:NIOServerCnxn$Factory@272] - Ignoring unexpected runtime exception
java.nio.channels.CancelledKeyException
  at gnu.java.nio.SelectionKeyImpl.readyOps(libgcj.so.10)
  at org.apache.zookeeper.server.NIOServerCnxn$Factory.run(NIOServerCnxn.java:241)
2013-03-27 16:07:23,052 - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:5181:NIOServerCnxn$Factory@272] - Ignoring unexpected runtime exception
java.nio.channels.CancelledKeyException
  at gnu.java.nio.SelectionKeyImpl.readyOps(libgcj.so.10)
  at org.apache.zookeeper.server.NIOServerCnxn$Factory.run(NIOServerCnxn.java:241)
2013-03-27 16:07:23,053 - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:5181:NIOServerCnxn$Factory@272] - Ignoring unexpected runtime exception
java.nio.channels.CancelledKeyException
  at gnu.java.nio.SelectionKeyImpl.readyOps(libgcj.so.10)
  at org.apache.zookeeper.server.NIOServerCnxn$Factory.run(NIOServerCnxn.java:241)
2013-03-27 16:07:23,054 - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:5181:NIOServerCnxn$Factory@272] - Ignoring unexpected runtime exception
java.nio.channels.CancelledKeyException
  at gnu.java.nio.SelectionKeyImpl.readyOps(libgcj.so.10)
  at org.apache.zookeeper.server.NIOServerCnxn$Factory.run(NIOServerCnxn.java:241)
2013-03-27 16:07:23,055 - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:5181:NIOServerCnxn$Factory@272] - Ignoring unexpected runtime exception
java.nio.channels.CancelledKeyException
  at gnu.java.nio.SelectionKeyImpl.readyOps(libgcj.so.10)
  at org.apache.zookeeper.server.NIOServerCnxn$Factory.run(NIOServerCnxn.java:241)
2013-03-27 16:07:23,056 - WARN
  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:5181:NIOServerCnxn$Factory@272]
  - Ignoring unexpected runtime exception

Root Cause:

This is happening due to the misconfiguration of node which is pointing to the GNU java instead of Oracle java or the Open-jdk

 

Solution :

MapR supports Oracle Java or OpenJDK. Please remove GNU Java and install either Oracle Java or OpenJDK Java versions and set JAVA_HOME appropriately.

1 person found this helpful

Attachments

    Outcomes