Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra nodetool java.lang.NullPointerException

When I run the command $ nodetool help I get the following error;

java.lang.NullPointerException
  at org.apache.cassandra.config.DatabaseDescriptor.getDiskFailurePolicy(DatabaseDescriptor.java:1877)
  at org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:62)
  at org.apache.cassandra.io.util.FileUtils.<clinit>(FileUtils.java:79)
  at org.apache.cassandra.utils.FBUtilities.getToolsOutputDirectory(FBUtilities.java:807)
  at org.apache.cassandra.tools.NodeTool.printHistory(NodeTool.java:199)
  at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:167)

Please let me know if anyone has any tips.

like image 832
Payal Zilaro Avatar asked Dec 14 '22 18:12

Payal Zilaro


1 Answers

I've got the same error.

I suggest you too use java 7 or 8 (not tested 7), and not java 9 or 10.

$ java -version # java 8

java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

$ java --version # java 9

java 9.0.4
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)

$ nodetool # java 9

error: null
-- StackTrace --
java.lang.NullPointerException
    at org.apache.cassandra.config.DatabaseDescriptor.getDiskFailurePolicy(DatabaseDescriptor.java:1881)
    at org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:82)
    at org.apache.cassandra.io.util.FileUtils.<clinit>(FileUtils.java:79)
    at org.apache.cassandra.utils.FBUtilities.getToolsOutputDirectory(FBUtilities.java:788)
    at org.apache.cassandra.tools.NodeTool.printHistory(NodeTool.java:200)
    at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:168)

I assume cassandra code try to parse java version somewhere and don't handle lastest java versions

like image 56
Le Petit Monde de Purexo Avatar answered Dec 30 '22 17:12

Le Petit Monde de Purexo