Home Help Center

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.

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    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.
  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    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, Matthew
  • Lam DangLam Dang Member
    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.
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Strange. Did you try any of the suggestions on Sleepycat's site?
  • Lam DangLam Dang Member
    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.
Sign In or Register to comment.