Bug 976822

Summary: UnsatisfiedLinkError reported by Cassandra and Storage plugins on plugin container restart
Product: [Other] RHQ Project Reporter: John Sanda <jsanda>
Component: PluginsAssignee: John Sanda <jsanda>
Status: CLOSED NOTABUG QA Contact: Mike Foley <mfoley>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.8CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-23 01:51:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 951619    

Description John Sanda 2013-06-21 14:35:35 UTC
Description of problem:
When the plugin restarts (without completely shutting down the JVM), the cassandra and rhq-storage plugins will write an exception to stderr that looks like,

ava.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.xerial.snappy.SnappyLoader.loadNativeLibrary(SnappyLoader.java:311)
	at org.xerial.snappy.SnappyLoader.load(SnappyLoader.java:217)
	at org.xerial.snappy.Snappy.<clinit>(Snappy.java:48)
	at org.apache.cassandra.transport.FrameCompressor$SnappyCompressor.<init>(FrameCompressor.java:68)
	at org.apache.cassandra.transport.FrameCompressor$SnappyCompressor.<clinit>(FrameCompressor.java:43)
	at com.datastax.driver.core.ProtocolOptions$Compression.<clinit>(ProtocolOptions.java:32)
	at com.datastax.driver.core.Cluster$Builder.<init>(Cluster.java:255)
	at com.datastax.driver.core.Cluster.builder(Cluster.java:105)
	at org.rhq.plugins.cassandra.CassandraNodeComponent.start(CassandraNodeComponent.java:105)
	at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:634)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.UnsatisfiedLinkError: Native Library /private/var/folders/jl/z6_0sq6n3vl7x2jnpwfjq4vw0000gn/T/snappy-1.0.531-libsnappyjava.jnilib already loaded in another classloader
	at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1905)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
	at java.lang.Runtime.load0(Runtime.java:792)
	at java.lang.System.load(System.java:1059)
	at org.xerial.snappy.SnappyNativeLoader.load(SnappyNativeLoader.java:39)
	... 22 more

This exception is coming from the snappy-java library. Neither the cassandra nor rhq-storage plugins are using compression. The driver though uses a class that attempts to load the native snappy library in a static initialization block. That class is FrameCompressor which is part of the Cassandra distribution and used by the driver. FrameCompressor correctly handles the exception. The snappy-java library however, makes a printStackTrace call before propagating the exception.

The exception will be noticeable if you run the agent in the foreground in console mode. 

The exceptions can be ignored. They do not impact the functionality of either the cassandra or the rhq-storage plugins.

Unfortunately, there are is no easy way to suppress them errors from being reported to stderr. We may look at applying some patches to snappy-java because this issue is coming up elsewhere and if nothing else, it makes it increasingly difficult to determine what is and what is not actually an error.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 John Sanda 2013-08-23 01:51:55 UTC
I am closing this out since we no longer package the snappy-java native library with the cassandra or with the rhq-storage plugins.