← Back to team overview

openjdk team mailing list archive

[Bug 1027122] Re: JNI applications fail because shared libraries cannot be found

 

I tried running NativeTest.java from bug 737603 with the same
environment variables that are used for the jScope invocation (exept the
classtpath):

Before the upgrade:

$ LD_LIBRARY_PATH=:/opt/hbt/valen/lib/i686/:/opt/mdsplus//lib SHLIB_PATH=:/opt/mdsplus//lib DYLD_LIBRARY_PATH=:/opt/mdsplus//lib /usr/bin/java -Xmx128M NativeTest JavaMds
java.library.path: /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk/jre/../lib/amd64::/opt/hbt/valen/lib/i686/:/opt/mdsplus//lib:/usr/java/packages/lib/amd64:/usr/lib/jni:/lib:/usr/lib
sun.boot.library.path: /usr/lib/jvm/java-6-openjdk/jre/lib/amd64
System.mapLibraryName(): libJavaMds.so

After the upgrade:

$ LD_LIBRARY_PATH=:/opt/hbt/valen/lib/i686/:/opt/mdsplus//lib SHLIB_PATH=:/opt/mdsplus//lib DYLD_LIBRARY_PATH=:/opt/mdsplus//lib /usr/bin/java -Xmx128M NativeTest JavaMds
java.library.path: /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk/jre/../lib/amd64::/opt/hbt/valen/lib/i686/:/opt/mdsplus//lib:/usr/java/packages/lib/amd64:/usr/lib/jni:/lib:/usr/lib
sun.boot.library.path: /usr/lib/jvm/java-6-openjdk/jre/lib/amd64
System.mapLibraryName(): libJavaMds.so
Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/mdsplus/lib/libJavaMds.so: libhpi.so: cannot open shared object file: No such file or directory
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1750)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1675)
	at java.lang.Runtime.loadLibrary0(Runtime.java:840)
	at java.lang.System.loadLibrary(System.java:1047)
	at NativeTest.main(NativeTest.java:6)

-- 
You received this bug notification because you are a member of OpenJDK,
which is subscribed to openjdk-6 in Ubuntu.
https://bugs.launchpad.net/bugs/1027122

Title:
  JNI applications fail because shared libraries cannot be found

Status in “openjdk-6” package in Ubuntu:
  New

Bug description:
  The update from OpenJDK 6b20-1.9.13-0ubuntu1~10.04.1 to
  6b21.2-2ubuntu0.10.04.1 in Lucid broke JNI applications. Attempts to
  run a JNI application now crash with:

  $ jScope
  Load library java.lang.UnsatisfiedLinkError: /opt/mdsplus/lib/libJavaMds.so: libhpi.so: cannot open shared object file: No such file or directory
  java.lang.UnsatisfiedLinkError: /opt/mdsplus/lib/libJavaMds.so: libhpi.so: cannot open shared object file: No such file or directory
   at java.lang.ClassLoader$NativeLibrary.load(Native Method)
   at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1750)
   at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1675)
   at java.lang.Runtime.loadLibrary0(Runtime.java:840)
   at java.lang.System.loadLibrary(System.java:1047)
   at jScope.LocalDataProvider.<clinit>(LocalDataProvider.java:192)
   at java.lang.Class.forName0(Native Method)/
   at java.lang.Class.forName(Class.java:186)
   at jScope.jScopeWaveContainer.SetDataServer(jScopeWaveContainer.java:1360)

  Downgrading all packages created by the OpenJDK source package to
  6b20-1.9.13-0ubuntu1~10.04.1 fixes the problem.

  libhpi.so is located in
  /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/native_threads/libhpi.so, so
  the problem can be temporarily fixed by setting
  LD_LIBRARY_PATH=/usr/lib/jvm/java-6-openjdk/jre/lib/amd64/native_threads/.
  However, this path is of course very dependent on the used JRE, so it
  needs to be set by java itself.

  ProblemType: Bug
  DistroRelease: Ubuntu 10.04
  Package: openjdk-6-jre-headless 6b24-1.11.3-1ubuntu0.10.04.1
  ProcVersionSignature: Ubuntu 3.0.0-23.38~lucid1-server 3.0.36
  Uname: Linux 3.0.0-23-server x86_64
  Architecture: amd64
  Date: Fri Jul 20 11:11:48 2012
  ProcEnviron:
   PATH=(custom, user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: openjdk-6

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/1027122/+subscriptions


References