ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juan Jimenez" <>
Subject Re: UnsatisfiedLinkError when invoking native library from junit task
Date Wed, 14 Jun 2006 11:47:34 GMT
For completeness, I am using:

Apache Ant version 1.6.5 compiled on June 2 2005

java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Server VM (build 1.5.0_05-b05, mixed mode)

On 14/06/06, Juan Jimenez <> wrote:
> Back in June 2004 there was a thread briefly discussing the problem of
> native libraries having dependencies on further native libraries and the
> apparent lack of support in ANT to modify Path or LD_LIBRARY_PATH as
> appropriate.  I am facing the problem (which I explain in more detail below)
> and I am posting this in the hope that things have moved on or someone had a
> bright idea on how to tackle this.
> ##### The Problem #####
> I use Cruisecontrol to build several branches of several different
> projects.  The build itself is done through ANT scripts which I have
> refactored extensively to avoid duplication.  As such, all projects have a
> standard location where they keep third party dependencies.  That includes
> both jar files and natibe libraries (DLLs for Windows and SOs for RHEL-3).
> Within the <junit> task I have included the following inner elements:
>             <sysproperty key="java.library.path" path="${junit.lib.path
> }"/>
>             <sysproperty key="LD_LIBRARY_PATH" path="${ junit.lib.path}"/>
>             <sysproperty key="PATH" path="${junit.lib.path}"/>
> where junit.lib.path is set to a path structure that includes all project
> specific dependencies (including DLLs and SOs).
> Our Java code can find any native library it needs (be it DLL or SO).
> However, if that native library tries to load further native libraries we
> get an UnsatisfiedLinkError
> Below is a sample stack trace showing that cannot find
> even though they are both in the same directory:
> java.lang.UnsatisfiedLinkError:
> /vob/gcib/etrading/projects/PricingImpl/lib/package/
> cannot open shared object file: No such file or directory
> at java.lang.ClassLoader$NativeLibrary.load(Native Method) at
> java.lang.ClassLoader.loadLibrary0( at
> java.lang.ClassLoader.loadLibrary( at
> java.lang.Runtime.loadLibrary0( at
> java.lang.System.loadLibrary( at
> irtkjava.LibLoader.loadNativeLibrary( at
> at
> Am I going to be forced to look into a nominated directory and preload
> anything that matches *.so before invoking a non-forked JVM for the unit
> tests?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message