• Post Reply Bookmark Topic Watch Topic
  • New Topic

JNI behaviour change on AIX (java5 -> java6)?  RSS feed

 
Simon Heffer
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this problem narowed down to a small test program:

If I run:

no problem.
If I run:

I get:
Exception in thread "main" java.lang.UnsatisfiedLinkError: rpm (No such file or directory)
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:993)
at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:962)
at java.lang.System.loadLibrary(System.java:465)
at jnitest.main(jnitest.java:7)

No changes to LIBPATH or anything between runs. I chose 'rpm' as a standard library in the standard place.
The java6 problem occurs regardless of whether the files is compiled with java5 or java6.

I'm assuming it's having problem resolving a reference in the library but it hasn't bothered to tell me which one so I'm in the dark.
Any thoughts?
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does System.getProperty("java.library.path") return for both Java versions?
 
Simon Heffer
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java5 properties:
com.ibm.cpu.endian is big
com.ibm.oti.configuration is scar
com.ibm.oti.jcl.build is 20080809_1128
com.ibm.oti.vm.bootstrap.library.path is /usr/java5/jre/bin
com.ibm.oti.vm.library.version is 23
com.ibm.util.extralibs.properties is
com.ibm.vm.bitmode is 32
file.encoding is ISO8859-1
file.separator is /
ibm.signalhandling.rs is false
ibm.signalhandling.sigchain is true
ibm.signalhandling.sigint is true
ibm.system.encoding is ISO8859-1
invokedviajava is
java.assistive is ON
java.awt.fonts is
java.awt.graphicsenv is sun.awt.X11GraphicsEnvironment
java.awt.printerjob is sun.print.PSPrinterJob
java.class.path is .
java.class.version is 49.0
java.compiler is j9jit23
java.ext.dirs is /usr/java5/jre/lib/ext
java.fullversion is J2RE 1.5.0 IBM J9 2.3 AIX ppc-32 j9vmap3223ifx-20080811 (JIT enabled)
J9VM - 20080809_21892_bHdSMr
JIT - 20080620_1845_r8
GC - 200806_19
java.home is /usr/java5/jre
java.io.tmpdir is /tmp/
java.jcl.version is 20080811b
java.library.path is /usr/java5/jre/bin:/usr/java5/jre/bin:/usr/java5/jre/bin/classic:/usr/java5/jre/bin:.:/home/hub/staff/smh/bl_67/safenet/testware/vspl/lib:/usr/local/lib:usrlocal/apr/lib:/usr/local/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.4:/usr/java5/jre/bin/j9vm:.:/home/hub/staff/smh/bl_67/safenet/testware/vspl/lib:/usr/local/lib:usrlocal/apr/lib:/usr/local/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.4:/usr/lib:/lib:/usr/lib
java.runtime.name is Java(TM) 2 Runtime Environment, Standard Edition
java.runtime.version is pap32devifx-20080811c (SR8a)
java.specification.name is Java Platform API Specification
java.specification.vendor is Sun Microsystems Inc.
java.specification.version is 1.5
java.util.prefs.PreferencesFactory is java.util.prefs.FileSystemPreferencesFactory
java.vendor is IBM Corporation
java.vendor.url is http://www.ibm.com/
java.version is 1.5.0
java.vm.info is J2RE 1.5.0 IBM J9 2.3 AIX ppc-32 j9vmap3223ifx-20080811 (JIT enabled)
J9VM - 20080809_21892_bHdSMr
JIT - 20080620_1845_r8
GC - 200806_19
java.vm.name is IBM J9 VM
java.vm.specification.name is Java Virtual Machine Specification
java.vm.specification.vendor is Sun Microsystems Inc.
java.vm.specification.version is 1.0
java.vm.vendor is IBM Corporation
java.vm.version is 2.3
jxe.current.romimage.version is 9
jxe.lowest.romimage.version is 9
line.separator is

os.arch is ppc
os.name is AIX
os.version is 5.3
path.separator is :
sun.arch.data.model is 32
sun.boot.class.path is /usr/java5/jre/lib/vm.jar:/usr/java5/jre/lib/core.jar:/usr/java5/jre/lib/charsets.jar:/usr/java5/jre/lib/graphics.jar:/usr/java5/jre/lib/security.jar:/usr/java5/jre/lib/ibmpkcs.jar:/usr/java5/jre/lib/ibmorb.jar:/usr/java5/jre/lib/ibmcfw.jar:/usr/java5/jre/lib/ibmorbapi.jar:/usr/java5/jre/lib/ibmjcefw.jar:/usr/java5/jre/lib/ibmjgssprovider.jar:/usr/java5/jre/lib/ibmjsseprovider2.jar:/usr/java5/jre/lib/ibmjaaslm.jar:/usr/java5/jre/lib/ibmcertpathprovider.jar:/usr/java5/jre/lib/server.jar:/usr/java5/jre/lib/xml.jar
sun.boot.library.path is /usr/java5/jre/bin
sun.io.unicode.encoding is UnicodeBig
sun.java2d.fontpath is
sun.jnu.encoding is ISO8859-1
user.country is US
user.dir is /home/hub/staff/smh
user.home is /home/hub
user.language is en
user.name is hub
user.timezone is
user.variant is

Java6 properties:
com.ibm.cpu.endian is big
com.ibm.jcl.checkClassPath is
com.ibm.oti.configuration is scar
com.ibm.oti.jcl.build is 20080613_1526
com.ibm.oti.shared.enabled is false
com.ibm.oti.vm.bootstrap.library.path is /usr/java6/jre/lib/ppc
com.ibm.oti.vm.library.version is 24
com.ibm.util.extralibs.properties is
com.ibm.vm.bitmode is 32
file.encoding is ISO8859-1
file.separator is /
ibm.signalhandling.rs is false
ibm.signalhandling.sigchain is true
ibm.signalhandling.sigint is true
ibm.system.encoding is ISO8859-1
java.assistive is ON
java.awt.fonts is
java.awt.graphicsenv is sun.awt.X11GraphicsEnvironment
java.awt.printerjob is sun.print.PSPrinterJob
java.class.path is .
java.class.version is 50.0
java.compiler is j9jit24
java.endorsed.dirs is /usr/java6/jre/lib/endorsed
java.ext.dirs is /usr/java6/jre/lib/ext
java.fullversion is J2RE 1.6.0 IBM J9 2.4 AIX ppc-32 jvmap3260-20080816_22093 (JIT enabled, AOT enabled)
J9VM - 20080816_022093_bHdSMr
JIT - r9_20080721_1330ifx2
GC - 20080724_AA
java.home is /usr/java6/jre
java.io.tmpdir is /tmp/
java.jcl.version is 20080808_02
java.library.path is /usr/java6/jre/lib/ppc:/usr/lib:/usr/java6/jre/lib/ppc:/usr/java6/jre/lib/ppc/j9vm:/usr/java6/jre/lib/ppc/j9vm:/usr/java6/jre/lib/ppc:/usr/java6/jre/../lib/ppc:.:/home/hub/staff/smh/bl_67/safenet/testware/vspl/lib:/usr/local/lib:usrlocal/apr/lib:/usr/local/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.4:/usr/lib:/lib:.:/home/hub/staff/smh/bl_67/safenet/testware/vspl/lib:/usr/local/lib:usrlocal/apr/lib:/usr/local/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.4:/usr/lib:/lib:/usr/lib
java.runtime.name is Java(TM) SE Runtime Environment
java.runtime.version is jvmap3260-20080816_22093
java.specification.name is Java Platform API Specification
java.specification.vendor is Sun Microsystems Inc.
java.specification.version is 1.6
java.util.prefs.PreferencesFactory is java.util.prefs.FileSystemPreferencesFactory
java.vendor is IBM Corporation
java.vendor.url is http://www.ibm.com/
java.version is 1.6.0
java.vm.info is J2RE 1.6.0 IBM J9 2.4 AIX ppc-32 jvmap3260-20080816_22093 (JIT enabled, AOT enabled)
J9VM - 20080816_022093_bHdSMr
JIT - r9_20080721_1330ifx2
GC - 20080724_AA
java.vm.name is IBM J9 VM
java.vm.specification.name is Java Virtual Machine Specification
java.vm.specification.vendor is Sun Microsystems Inc.
java.vm.specification.version is 1.0
java.vm.vendor is IBM Corporation
java.vm.version is 2.4
jxe.current.romimage.version is 13
jxe.lowest.romimage.version is 13
line.separator is

os.arch is ppc
os.name is AIX
os.version is 5.3
path.separator is :
sun.arch.data.model is 32
sun.boot.class.path is /usr/java6/jre/lib/vm.jar:/usr/java6/jre/lib/annotation.jar:/usr/java6/jre/lib/beans.jar:/usr/java6/jre/lib/java.util.jar:/usr/java6/jre/lib/jndi.jar:/usr/java6/jre/lib/logging.jar:/usr/java6/jre/lib/security.jar:/usr/java6/jre/lib/sql.jar:/usr/java6/jre/lib/ibmorb.jar:/usr/java6/jre/lib/ibmorbapi.jar:/usr/java6/jre/lib/ibmcfw.jar:/usr/java6/jre/lib/rt.jar:/usr/java6/jre/lib/charsets.jar:/usr/java6/jre/lib/resources.jar:/usr/java6/jre/lib/ibmpkcs.jar:/usr/java6/jre/lib/ibmcertpathfw.jar:/usr/java6/jre/lib/ibmjgssfw.jar:/usr/java6/jre/lib/ibmjssefw.jar:/usr/java6/jre/lib/ibmsaslfw.jar:/usr/java6/jre/lib/ibmjcefw.jar:/usr/java6/jre/lib/ibmjgssprovider.jar:/usr/java6/jre/lib/ibmjsseprovider2.jar:/usr/java6/jre/lib/ibmcertpathprovider.jar:/usr/java6/jre/lib/ibmxmlcrypto.jar:/usr/java6/jre/lib/management-agent.jar:/usr/java6/jre/lib/xml.jar:/usr/java6/jre/lib/jlm.jar:/usr/java6/jre/lib/javascript.jar
sun.boot.library.path is /usr/java6/jre/lib/ppc
sun.io.unicode.encoding is UnicodeBig
sun.java.command is ShowProps
sun.java.launcher is SUN_STANDARD
sun.java2d.fontpath is
sun.jnu.encoding is ISO8859-1
user.country is US
user.dir is /home/hub/staff/smh
user.home is /home/hub
user.language is en
user.name is hub
user.timezone is
user.variant is
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did an analysis on the contents of both java.library.path properties, and found the following after sorting and filtering out duplicates:

Java 5:
.
/home/hub/staff/smh/bl_67/safenet/testware/vspl/lib
/lib
/usr/java5/jre/bin
/usr/java5/jre/bin/classic
/usr/java5/jre/bin/j9vm
/usr/lib
/usr/lib
/usr/local/lib
/usr/local/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.4
usrlocal/apr/lib

Java 6:
.
/home/hub/staff/smh/bl_67/safenet/testware/vspl/lib
/lib
/usr/java6/jre/../lib/ppc
/usr/java6/jre/lib/ppc
/usr/java6/jre/lib/ppc/j9vm
/usr/lib
/usr/lib
/usr/local/lib
/usr/local/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.4
usrlocal/apr/lib

Differences: /usr/java5/jre/bin, /usr/java5/jre/bin/classic and /usr/java5/jre/bin/j9vm for Java 5 vs /usr/java6/jre/../lib/ppc, /usr/java6/jre/lib/ppc and /usr/java6/jre/lib/ppc/j9vm for Java 6.


Now, where exactly is file librpm.so located?
 
Simon Heffer
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
/usr/lib
That's why I chose it to test with.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then I have no idea why it fails. /usr/lib is in the library path so your program should be able to use it.

There is one thing you could try: use System.load("/usr/lib/librpm.so").
 
Simon Heffer
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Me neither.

I guess I could use System.load but the whole point of the exercise is to find out why System.loadLibrary is failing using java6.
This problem is specific to AIX - works fine on redhat and solaris and Windows.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!