java.lang.reflect.InvocationTargetException

tip

When installing an APK, it automatically extracts the libraries of the right arch type and has them available for System.loadLibrary. But, if you're trying to load a non-standard library, the installer won't know your app has 32bit native code.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • 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.
    via by Vishy Kasar,
  • 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.
    via by Vishy Kasar,
    • 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) ... 11 more

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    franky li
    franky li134 times, last one,
    82 more bugmates