Archived
This forum has been archived. Please start a new discussion on GitHub.
Error "no db_java-4.1..."
Running tests in /usr/local/src/IceJ-1.0.0 on RH8.0 , I got this error:
*** running tests in ./test/Freeze/cursor:
starting client... ok
Exception in thread "main" java.lang.UnsatisfiedLinkError: no db_java-4.1 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:832)
at com.sleepycat.db.Db.load_db(Db.java:589)
at com.sleepycat.db.Db.<clinit>(Db.java:610)
at com.sleepycat.db.DbEnv.<clinit>(DbEnv.java:426)
at Freeze.DBEnvironmentI.<init>(DBEnvironmentI.java:243)
at Freeze.Util.initialize(Util.java:22)
at Client.main(Unknown Source)
test failed with exit status 1
I was using Sleepy Cat's db-4.1.25 because it's the only one available at their download site. (I didn't remove the db4*-4.0.14-14 RPMs that came with RH 8.0. )
Here's my CLASSPATH:
.:/usr/local/src/IceJ-1.0.0/lib/Ice.jar:/usr/local/src/db-4.1.25/build_unix/db.jar
I'd already built the C++ version of Ice-1.0.0 and run its test suite without any error.
Any advice will be appreciated.
*** running tests in ./test/Freeze/cursor:
starting client... ok
Exception in thread "main" java.lang.UnsatisfiedLinkError: no db_java-4.1 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:832)
at com.sleepycat.db.Db.load_db(Db.java:589)
at com.sleepycat.db.Db.<clinit>(Db.java:610)
at com.sleepycat.db.DbEnv.<clinit>(DbEnv.java:426)
at Freeze.DBEnvironmentI.<init>(DBEnvironmentI.java:243)
at Freeze.Util.initialize(Util.java:22)
at Client.main(Unknown Source)
test failed with exit status 1
I was using Sleepy Cat's db-4.1.25 because it's the only one available at their download site. (I didn't remove the db4*-4.0.14-14 RPMs that came with RH 8.0. )
Here's my CLASSPATH:
.:/usr/local/src/IceJ-1.0.0/lib/Ice.jar:/usr/local/src/db-4.1.25/build_unix/db.jar
I'd already built the C++ version of Ice-1.0.0 and run its test suite without any error.
Any advice will be appreciated.
0
Comments
-
The Java version of BerkeleyDB is layered on the C version using JNI, therefore you must have the directory containing libdb_java-4.1.so in your LD_LIBRARY_PATH.0
-
Hi,
You also need to add the directory containing the berkeley db shared libraries (such as libdb_java-4.1.so) to your LD_LIBRARY_PATH.
You can download the older distributions here:
http://www.sleepycat.com/download/patchlogs.shtml
Regards, Matthew0 -
Thanks for your quick responses. But going back to db4.0 and even db3.3 didn't seem to help. I got exactly the same error with them. Obviously it's something in my setup. I checked and rechecked the following:
- Ice.jar and db.jar in CLASSPATH
- libdb_java-[4.1, 4.0, 3.3].so in either LD_LIBRARY_PATH or in a directory (e.g., /usr/local/lib) included in /etc/ld.so.conf
- Rebooting a couple of times.
db4.0 should work for IceJ because it does work for Ice on the same box.
Any pointers will be appreciated.0 -
Sorry I goofed! I didn't set LD_LIBRARY_PATH correctly.
The IceJ test suite ran OK with db-4.1.25, but failed at the first Freeze test with db-4.0.14. Here's my setup:
export CLASSPATH=.:/usr/local/src/IceJ-1.0.0/lib/Ice.jar:/usr/local/src/db-4.1.25/build_unix/db.jar
export LD_LIBRARY_PATH=/usr/local/src/db-4.1.25/build_unix/.libs
export ICE_HOME=/usr/local/src/Ice-1.0.0
Thanks for your help.0