Hi all,
RHEL6 comes with the native sigar library available:
http://rhn.redhat.com/errata/RHEA-2011-0670.html
This provides the following files:
/usr/lib64/libsigar.so
/usr/share/doc/sigar-1.6.5
/usr/share/doc/sigar-1.6.5/AUTHORS
/usr/share/doc/sigar-1.6.5/ChangeLog
/usr/share/doc/sigar-1.6.5/LICENSE
/usr/share/doc/sigar-1.6.5/NOTICE
/usr/share/doc/sigar-1.6.5/README
So far so good.
We are now trying to use sigar from java on this staging box, and we cannot get our test cases to run at all. we see the following two errors:
java.lang.NoClassDefFoundError: Could not initialize class org.hyperic.sigar.Sigar
java.lang.UnsatisfiedLinkError: org.hyperic.sigar.Sigar.getNativeVersion()Ljava/lang/String;
Unfortunately neither error gives us a clue as to why Sigar is failing, the java.lang.UnsatisfiedLinkError message seems to be printing a bogus string instead of the actual error, so we remain in the dark.
Reverse engineering the sigar java binding, we find a complex library loading mechanism that attempts to introspect the architecture of the machine and load a custom-named library with the architecture of the machine embedded into it. This mechanism however doesn't seem to contain any mechanism to load a normal, ordinary system library as provided by the operating system as it is in this case.
My question is thus this:
- How do we use the sigar java bindings with the sigar library as shipped by Redhat?
- Is this even possible?
- Has Redhat done some kind of customisation to make this work, and if so is this documented anywhere?
- Has anyone got this to work?
To make things clear, we need to roll out this code on many nodes, we cannot use a custom hacked solution. We either need to discover what we're doing wrong and do it the right way, or if the java bindings can't work with Redhat's system sigar library at all, we will have to maintain a custom version of the sigar library with this bug fixed.
Can anyone shed any light on this?
Regards,
Graham
--