XDOMOpen() fails on RedHat
June 22, 2011 1 Comment
The Issue
The default installation of UniVerse 10.3.x on RedHat does not correctly setup the server so that UniVerse can find it’s shared libraries.
This shows up when code attempts to use the XDOMOpen() function by generating the error:
Program "xyz": Line nn, Can't load "/usr/ibm/uv/bin/libxml.so": libxslt4c.so.111: cannot open shared object file: No such file or directory
Once a UV session has generated this error, it will not generate it again, which is sort of nice. Except that the XDOMOpen() function continues to fail!
There are a couple of technotes on the Rocket Software website that explain this issue, but their suggested solution is to assign the environment variable LD_LIBRARY_PATH with the path to the bin directory in the uv installation directory (i.e. LD_LIBRARY_PATH=”`cat /.uvhome`/bin”) prior to using uv.
Whilst this solution does work, it is not recommended for production environments (at least that is the feedback I get from reearching this environment variable). Add to that the effort needed to setup the assignment of the variable for all logins that use uv. Now you are getting a messy install & configuration effort just to be able to use the XML functionality in UV.
The Solution
There is a more robust alternative to setting the environment variable. It is a cache of links to the most recent shared libraries found on a system, which is used by ld.so – the RH run-time linker. This cache is built and maintained by the ldconfig command.
To update the shared library cache with UniVerse libraries perform the following as user ‘root’:
echo `cat /.uvhome`/bin > /etc/ld.so.conf.d/UniVerse.conf ldconfig
To check that the cache has been updated, run the following and confirm there are files in the UV installatin directory:
ldconfig -p|grep "/uv/"
Now that this is done, every time you start UniVerse it will be able to load the necessary shared library modules needed to support the XML functionality.