[collectd] [Bug 568234] [NEW] java plugin does not work with non-openjdk java

Sebastian Harl tokkee at collectd.org
Thu Apr 22 12:29:29 CEST 2010


Hi,

On Thu, Apr 22, 2010 at 04:14:19AM -0000, Gabriel Nell wrote:
> I'm on lucid, and I've installed collectd-core and sun-java6-jdk from
> the partners repository. Updating collectd.conf to have "LoadPlugin
> java" results in the following failure:
> 
> lt_dlopen (/usr/lib/collectd/java.so) failed: file not found
> Unable to load plugin java.
> 
> The file referenced does in fact exist. I think what's going on is that
> java.so was built statically linking to the openjdk location of
> libjvm.so. Installing openjdk-6-jdk resolved the issue.

Mostly right (it's not statically linked but it includes a static search
path compiled in, i.e. an rpath). The problem is that libjvm.so (no
matter which Java is used) can not be found in the search path of the
dynamic loader. So, there needs to be some way to tell the loader where
to find libjvm.so and this is currently done by specifying an rpath.

I can think of the following alternate way to handle this (and, afaik,
this is the most common approach used in that case): let the "java"
plugin search for libjvm.so itself and load it using dlopen(). The
search path could then include a built-in default, a configurable path
and $JAVA_HOME (in order of increasing priority). Patches would be very
welcome! :-)

As a work-around for now, you should be able to run collectd as
`LD_PRELOAD=/path/to/whatever/libjvm.so collectd'. The loader then won't
try to load libjvm.so again. Also, specifying an appropriate
LD_LIBRARY_PATH should do the trick. The former could be used to
explicitly specify which Java should be used.

> The bug here is that the collectd-core package has a hidden dependancy
> on a specific flavor of java. I suspect this repros on pre-lucid as
> well.

This has always been the case since the introduction of the "java"
plugin in collectd 4.7.0.

> -- 
> java plugin does not work with non-openjdk java
> https://bugs.launchpad.net/bugs/568234
> you received this bug notification because you are subscribed to
> collectd in ubuntu.

(JFTR)

Cheers,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20100422/b38f05d0/attachment.pgp 


More information about the collectd mailing list