15

When I try to start Cassandra after patching my OS, I get this error:

Exception (java.lang.AbstractMethodError) encountered during startup: org.apache.cassandra.utils.JMXServerUtils$Exporter.exportObject(Ljava/rmi/Remote;ILjava/rmi/server/RMIClientSocketFactory;Ljava/rmi/server/RMIServerSocketFactory;Lsun/misc/ObjectInputFilter;)Ljava/rmi/Remote;

java.lang.AbstractMethodError: org.apache.cassandra.utils.JMXServerUtils$Exporter.exportObject(Ljava/rmi/Remote;ILjava/rmi/server/RMIClientSocketFactory;Ljava/rmi/server/RMIServerSocketFactory;Lsun/misc/ObjectInputFilter;)Ljava/rmi/Remote;
        at javax.management.remote.rmi.RMIJRMPServerImpl.export(RMIJRMPServerImpl.java:150)
        at javax.management.remote.rmi.RMIJRMPServerImpl.export(RMIJRMPServerImpl.java:135)
        at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:405)
        at org.apache.cassandra.utils.JMXServerUtils.createJMXServer(JMXServerUtils.java:104)
        at org.apache.cassandra.service.CassandraDaemon.maybeInitJmx(CassandraDaemon.java:143)
        at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:188)
        at com.datastax.bdp.server.DseDaemon.setup(DseDaemon.java:476)
        at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:59
        at com.datastax.bdp.DseModule.main(DseModule.java:93)
ERROR [main] 2018-01-17 13:18:03,330  CassandraDaemon.java:705 - Exception encountered during startup
java.lang.AbstractMethodError: org.apache.cassandra.utils.JMXServerUtils$Exporter.exportObject(Ljava/rmi/Remote;ILjava/rmi/server/RMIClientSocketFactory;Ljava/rmi/server/RMIServerSocketFactory;Lsun/misc/ObjectInputFilter;)Ljava/rmi/Remote;

Does anyone know why, with no other changes, I'm running into this error now?

TylerH
  • 20,799
  • 66
  • 75
  • 101
chris
  • 253
  • 2
  • 5
  • 1
    You can use Java alternatives to point to an earlier jdk 8 version that works. I just did the same after landing on the latest jdk 8 and not being able to start DSE – apesa Jan 23 '18 at 21:56
  • 3
    This question is [discussed on Meta](https://meta.stackoverflow.com/questions/362651/is-this-really-a-good-question-not-to-be-closed?cb=1) – Thomas Weller Jan 29 '18 at 22:33

4 Answers4

31

This seems to relate to an upgrade to the JDK to 8u161 which was released 2 days ago.

A ticket has been opened on the Cassandra Jira

There is no published work-around that I can find. You might have to go back to an earlier version of the JDK or wait for Cassandra 3.11.2 which fixes the issue.

Edit: Its worth pointing out that this has now been resolved in 3.11.2 which has been released, so you can simply upgrade to this version to resolve the problem.

iandotkelly
  • 9,024
  • 8
  • 48
  • 67
  • More info here as well: https://lists.apache.org/thread.html/d7eaa0eaeae575230273a3a5c88dec15569686891b6c24b388688456@%3Cuser.cassandra.apache.org%3E – Simon Fontana Oscarsson Jan 19 '18 at 11:40
  • there is no 3.11.2 version available to download, I checked at https://academy.datastax.com/planet-cassandra/cassandra – Vikash Apr 12 '18 at 07:57
  • 1
    @Vikash .... http://www.apache.org/dyn/closer.lua/cassandra/3.11.2/apache-cassandra-3.11.2-bin.tar.gz – iandotkelly Apr 12 '18 at 10:56
  • 1
    @Vikash ... there's a link on the page you went to, and a notice that says "DataStax no longer provides the DataStax Community Edition or the DataStax Distribution of Apache Cassandra. " – iandotkelly Apr 12 '18 at 10:57
  • 1
    Updating Java to JDK 8u172 fixed this for me. – blacktide May 08 '18 at 12:06
4

To get Cassandra running I had to install JDK 8u152. Using brew cask install java8 it wasn't possible. I tried using an old version of the cassandra.rb formula but that just got:

Error: Download failed on Cask 'java8' with message: Download failed: http://download.oracle.com/otn-pub/java/jdk/8u152-b16/aa0333dd3019491ca4f6ddbe78cdb6d0/jdk-8u152-macosx-x64.dmg

I had to go here and log in to be able to download the DMG: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html

Protip: To still be able to install java8 using homebrew I downloaded the dmg myself, and started a server in the downloads directory:

cd ~/Downloads
php -S 0.0.0.0:3333

And changed the download URL (line 6) in the formula to:

url "http://0.0.0.0:3333/jdk-8u152-macosx-x64.dmg",

Then was able to run:

brew cask install java8

Now Cassandra is running again.

Erik Rothoff
  • 4,826
  • 9
  • 41
  • 59
3

You may download the source and add the changed method, compile and add the modified class to the apache-cassandra.jar. You can do the following:

  1. Download org.tar containing the only class to be replaced.
  2. Untar the file using tar -xvf org.tar and you should get org directory
  3. Copy the apache-cassandra jar file. e.g. cp /usr/share/cassandra/apache-cassandra-3.11.1.jar .
  4. Make a backup of the jar before you update. cp apache-cassandra-3.11.1.jar apache-cassandra-3.11.1.jar_backup.
  5. Expecting the current directory contains the following files: apache-cassandra-3.11.1.jar apache-cassandra-3.11.1.jar_backup org org.tar
  6. Execute the following command to update the jar:

    jar uf apache-cassandra-3.11.1.jar org

  7. Replace the file to installation location:

    mv apache-cassandra-3.11.1.jar /usr/share/cassandra

  8. Restart cassandra service

AlexITC
  • 1,054
  • 1
  • 10
  • 21
James Jithin
  • 10,183
  • 5
  • 36
  • 51
0

Revert Cask formula to 2017 version.

wget https://github.com/caskroom/homebrew-versions/blob/a98da98a7e4d87e9b614b3aa25af9c6c21a753c6/Casks/java8.rb -O /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask/Casks/java8.rb

change line 6 URL as suggested url "http://127.0.0.1:3333/jdk-8u152-macosx-x64.dmg",

brew cask reinstall java8

should work.

shooding
  • 128
  • 2
  • 9