java.lang.NoClassDefFoundError: com/sun/jna/Native

Apache's JIRA Issue Tracker | Alan Boudreault | 2 years ago
Do you find the tips below useful? Click on the to mark them and say thanks to rafael and Rafael Fischer Viola . Or join the community to write better ones.
  1. 0

    [~andrew.tolbert] discovered an issue while running endurance tests on 2.2. A Node was not able to start and was killed by the OOM Killer. Briefly, Cassandra use an excessive amount of memory when loading compressed sstables (off-heap?). We have initially seen the issue with system.hints before knowing it was related to compression. system.hints use lz4 compression by default. If we have a sstable of, say 8-10G, Cassandra will be killed by the OOM killer after 1-2 minutes. I can reproduce that bug everytime locally. * the issue also happens if we have 10G of data splitted in 13MB sstables. * I can reproduce the issue if I put a lot of data in the system.hints table. * I cannot reproduce the issue with a standard table using the same compression (LZ4). Something seems to be different when it's hints? You wont see anything in the node system.log but you'll see this in /var/log/syslog.log: {code} Out of memory: Kill process 30777 (java) score 600 or sacrifice child {code} The issue has been introduced in this commit but is not related to the performance issue in CASSANDRA-9240: Here is the core dump and some yourkit snapshots in attachments. I am not sure you will be able to get useful information from them. core dump: Not sure if this is related, but all dumps and snapshot points to EstimatedHistogramReservoir ... and we can see many org.apache.cassandra.metrics:... exceptions in system.log before it hangs then crash. To reproduce the issue: 1. created a cluster of 3 nodes 2. start the whole cluster 3. shutdown node2 and node3 4. writes 10-15G of data on node1 with replication factor 3. You should see a lot of hints. 5. stop node1 6. start node2 and node3 7. start node1, you should OOM. //cc [~tjake] [~benedict] [~andrew.tolbert]

    Apache's JIRA Issue Tracker | 2 years ago | Alan Boudreault
    java.lang.NoClassDefFoundError: com/sun/jna/Native
  2. 0
    samebug tip
    This was caused by a failure to instantiate Kafka broker. Check your dependencies.
  3. 0
    samebug tip
    This exception normally means you either have to add the said class to your dependencies or you miswrote it. Look in the documentation of your library how to add it as a dependency.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0
    samebug tip
    If you're using Hibernate, this indicates you're missing FasterXML Classmate dependency, which you can add with the following: <groupId>com.fasterxml</groupId> <artifactId>classmate</artifactId> <version>1.0</version>
  6. 0
    samebug tip
    NoClassDefFoundError means java has failed to find a class you're trying to instantiate, look if you've added the class you're trying to instantiate to the dependencies.
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.ClassNotFoundException


  2. Java RT
    3. Method)[na:1.7.0_76]
    5. java.lang.ClassLoader.loadClass([na:1.7.0_76]
    6. sun.misc.Launcher$AppClassLoader.loadClass([na:1.7.0_76]
    7. java.lang.ClassLoader.loadClass([na:1.7.0_76]
    7 frames
  3. org.apache.cassandra
    1. org.apache.cassandra.utils.memory.MemoryUtil.allocate([main/:na]
    11. org.apache.cassandra.db.Memtable$FlushRunnable.createFlushWriter([main/:na]
    12. org.apache.cassandra.db.Memtable$FlushRunnable.writeSortedContents([main/:na]
    13. org.apache.cassandra.db.Memtable$FlushRunnable.runMayThrow([main/:na]
    13 frames
  4. Apache Cassandra
    1 frame
  5. Guava
    1 frame
  6. org.apache.cassandra
    1. org.apache.cassandra.db.ColumnFamilyStore$[main/:na]
    1 frame
  7. Java RT
    1. java.util.concurrent.ThreadPoolExecutor.runWorker([na:1.7.0_76]
    2. java.util.concurrent.ThreadPoolExecutor$[na:1.7.0_76]
    3 frames