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

Apache's JIRA Issue Tracker | Alan Boudreault | 2 years ago
tip
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: https://github.com/apache/cassandra/commit/aedce5fc6ba46ca734e91190cfaaeb23ba47a846 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: http://dl.alanb.ca/core.tar.gz Not sure if this is related, but all dumps and snapshot points to EstimatedHistogramReservoir ... and we can see many javax.management.InstanceAlreadyExistsException: 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
    Check if you didn't forget to instantiate your topic in the kafka broker.
  3. 0
    samebug tip
    A few things cause this exception: 1) Check if you have all jars and if they're in the correct path when running. 2) Your classpath might be broken, you can define it in the command line with "java -cp yourClassPath" or at your IDE if you're using one.
  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 to your dependencies. To add it, the groupId is com.fasterxml and artifactId is Classmate.
  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

    com.sun.jna.Native

    at java.net.URLClassLoader$1.run()
  2. Java RT
    ClassLoader.loadClass
    1. java.net.URLClassLoader$1.run(URLClassLoader.java:366)[na:1.7.0_76]
    2. java.net.URLClassLoader$1.run(URLClassLoader.java:355)[na:1.7.0_76]
    3. java.security.AccessController.doPrivileged(Native Method)[na:1.7.0_76]
    4. java.net.URLClassLoader.findClass(URLClassLoader.java:354)[na:1.7.0_76]
    5. java.lang.ClassLoader.loadClass(ClassLoader.java:425)[na:1.7.0_76]
    6. sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)[na:1.7.0_76]
    7. java.lang.ClassLoader.loadClass(ClassLoader.java:358)[na:1.7.0_76]
    7 frames
  3. org.apache.cassandra
    Memtable$FlushRunnable.runMayThrow
    1. org.apache.cassandra.utils.memory.MemoryUtil.allocate(MemoryUtil.java:82)[main/:na]
    2. org.apache.cassandra.io.util.Memory.<init>(Memory.java:74)[main/:na]
    3. org.apache.cassandra.io.util.SafeMemory.<init>(SafeMemory.java:32)[main/:na]
    4. org.apache.cassandra.io.compress.CompressionMetadata$Writer.<init>(CompressionMetadata.java:274)[main/:na]
    5. org.apache.cassandra.io.compress.CompressionMetadata$Writer.open(CompressionMetadata.java:288)[main/:na]
    6. org.apache.cassandra.io.compress.CompressedSequentialWriter.<init>(CompressedSequentialWriter.java:73)[main/:na]
    7. org.apache.cassandra.io.util.SequentialWriter.open(SequentialWriter.java:167)[main/:na]
    8. org.apache.cassandra.io.sstable.format.big.BigTableWriter.<init>(BigTableWriter.java:75)[main/:na]
    9. org.apache.cassandra.io.sstable.format.big.BigFormat$WriterFactory.open(BigFormat.java:107)[main/:na]
    10. org.apache.cassandra.io.sstable.format.SSTableWriter.create(SSTableWriter.java:84)[main/:na]
    11. org.apache.cassandra.db.Memtable$FlushRunnable.createFlushWriter(Memtable.java:419)[main/:na]
    12. org.apache.cassandra.db.Memtable$FlushRunnable.writeSortedContents(Memtable.java:366)[main/:na]
    13. org.apache.cassandra.db.Memtable$FlushRunnable.runMayThrow(Memtable.java:351)[main/:na]
    13 frames
  4. Apache Cassandra
    WrappedRunnable.run
    1. org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28)[main/:na]
    1 frame
  5. Guava
    MoreExecutors$SameThreadExecutorService.execute
    1. com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297)[guava-16.0.jar:na]
    1 frame
  6. org.apache.cassandra
    ColumnFamilyStore$Flush.run
    1. org.apache.cassandra.db.ColumnFamilyStore$Flush.run(ColumnFamilyStore.java:1121)[main/:na]
    1 frame
  7. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[na:1.7.0_76]
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[na:1.7.0_76]
    3. java.lang.Thread.run(Thread.java:745)[na:1.7.0_76]
    3 frames