java.lang.reflect.InvocationTargetException

DataStax JIRA | Vishy Kasar | 2 years ago
  1. 0

    Even when the user uses the default ProtocolOptions.Compression.NONE, driver tries to initialize the Snappy and LZ4 compressors. When user does not have those jars in the class path, they get warnings like this: 2015-03-18 10:39:41 WARN FrameCompressor:44 - Cannot find Snappy class, you should make sure the Snappy library is in the classpath if you intend to use it. Snappy compression will not be available for the protocol. 2015-03-18 10:39:52 WARN FrameCompressor:87 - Cannot find LZ4 class, you should make sure the LZ4 library is in the classpath if you intend to use it. LZ4 compression will not be available for the protocol. At times, the jars are present in the class path but there is a problem with .so finding the right dependencies on the host. We see errors like: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.xerial.snappy.SnappyLoader.loadNativeLibrary(SnappyLoader.java:322) at org.xerial.snappy.SnappyLoader.load(SnappyLoader.java:229) at org.xerial.snappy.Snappy.<clinit>(Snappy.java:48) at com.datastax.driver.core.FrameCompressor$SnappyCompressor.<init>(FrameCompressor.java:55) at com.datastax.driver.core.FrameCompressor$SnappyCompressor.<clinit>(FrameCompressor.java:41) at com.datastax.driver.core.ProtocolOptions$Compression.<clinit>(ProtocolOptions.java:35) at com.datastax.driver.core.Cluster$Builder.<init>(Cluster.java:542) Caused by: java.lang.UnsatisfiedLinkError: /tmp/snappy-1.0.5-libsnappyjava.so: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /tmp/snappy-1.0.5-libsnappyjava.so) at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703) at java.lang.Runtime.load0(Runtime.java:770) at java.lang.System.load(System.java:1003) at org.xerial.snappy.SnappyNativeLoader.load(SnappyNativeLoader.java:39) ... 44 more These errors confuse the novice users. We can avoid these things by delaying loading of compression classes until needed.

    DataStax JIRA | 2 years ago | Vishy Kasar
    java.lang.reflect.InvocationTargetException
  2. 0

    Even when the user uses the default ProtocolOptions.Compression.NONE, driver tries to initialize the Snappy and LZ4 compressors. When user does not have those jars in the class path, they get warnings like this: 2015-03-18 10:39:41 WARN FrameCompressor:44 - Cannot find Snappy class, you should make sure the Snappy library is in the classpath if you intend to use it. Snappy compression will not be available for the protocol. 2015-03-18 10:39:52 WARN FrameCompressor:87 - Cannot find LZ4 class, you should make sure the LZ4 library is in the classpath if you intend to use it. LZ4 compression will not be available for the protocol. At times, the jars are present in the class path but there is a problem with .so finding the right dependencies on the host. We see errors like: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.xerial.snappy.SnappyLoader.loadNativeLibrary(SnappyLoader.java:322) at org.xerial.snappy.SnappyLoader.load(SnappyLoader.java:229) at org.xerial.snappy.Snappy.<clinit>(Snappy.java:48) at com.datastax.driver.core.FrameCompressor$SnappyCompressor.<init>(FrameCompressor.java:55) at com.datastax.driver.core.FrameCompressor$SnappyCompressor.<clinit>(FrameCompressor.java:41) at com.datastax.driver.core.ProtocolOptions$Compression.<clinit>(ProtocolOptions.java:35) at com.datastax.driver.core.Cluster$Builder.<init>(Cluster.java:542) Caused by: java.lang.UnsatisfiedLinkError: /tmp/snappy-1.0.5-libsnappyjava.so: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /tmp/snappy-1.0.5-libsnappyjava.so) at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703) at java.lang.Runtime.load0(Runtime.java:770) at java.lang.System.load(System.java:1003) at org.xerial.snappy.SnappyNativeLoader.load(SnappyNativeLoader.java:39) ... 44 more These errors confuse the novice users. We can avoid these things by delaying loading of compression classes until needed.

    DataStax JIRA | 2 years ago | Vishy Kasar
    java.lang.reflect.InvocationTargetException
  3. 0

    Replace JNI Snappy with native Java version

    GitHub | 4 years ago | shenfeng
    java.lang.reflect.InvocationTargetException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

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.UnsatisfiedLinkError

    /tmp/snappy-1.0.5-libsnappyjava.so: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /tmp/snappy-1.0.5-libsnappyjava.so)

    at java.lang.ClassLoader$NativeLibrary.load()
  2. Java RT
    System.load
    1. java.lang.ClassLoader$NativeLibrary.load(Native Method)
    2. java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
    3. java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
    4. java.lang.Runtime.load0(Runtime.java:770)
    5. java.lang.System.load(System.java:1003)
    5 frames
  3. snappy-java
    SnappyNativeLoader.load
    1. org.xerial.snappy.SnappyNativeLoader.load(SnappyNativeLoader.java:39)
    1 frame
  4. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:597)
    4 frames
  5. snappy-java
    Snappy.<clinit>
    1. org.xerial.snappy.SnappyLoader.loadNativeLibrary(SnappyLoader.java:322)
    2. org.xerial.snappy.SnappyLoader.load(SnappyLoader.java:229)
    3. org.xerial.snappy.Snappy.<clinit>(Snappy.java:48)
    3 frames
  6. DataStax Java Driver for Apache Cassandra - Core
    Cluster$Builder.<init>
    1. com.datastax.driver.core.FrameCompressor$SnappyCompressor.<init>(FrameCompressor.java:55)
    2. com.datastax.driver.core.FrameCompressor$SnappyCompressor.<clinit>(FrameCompressor.java:41)
    3. com.datastax.driver.core.ProtocolOptions$Compression.<clinit>(ProtocolOptions.java:35)
    4. com.datastax.driver.core.Cluster$Builder.<init>(Cluster.java:542)
    4 frames