Home Help Center

install instructions for IceJ 2.0.0

The installation instructions for Ice for Java 2.0.0 state:
"Freeze for Java uses Berkeley DB as its underlying database. It requires
Berkeley DB 4.2.52"

However, when I run the tests I get the following error:
*** running tests in ./test/Freeze/dbmap
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:1491)
...

I tried recompiling Java per the instructions but I get error:
[javac] ./IceJ-2.0.0/src/Freeze/Map.java:172: cannot resolve symbol
[javac] symbol : method setFlags (int)
[javac] location: class com.sleepycat.db.Dbt
[javac] dbValue.setFlags(com.sleepycat.db.Db.DB_DBT_PARTIAL);
[javac] ^

...

I recall having similar problems when I installed Ice 1.5.1 but I was able to recompile the Java source. Any ideas? Whatever the solution, I need it to work with both the C++ and Java implementations of Ice.

Thanks!

Comments

  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    You need to include the jar for Berkeley DB in your CLASSPATH.

    Cheers,

    Michi.
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    It looks like you need to build Berkeley DB 4.2.52, and that you have Berkeley DB 4.1.x 's jar file in your CLASSPATH.

    Cheers,
    Bernard
  • tvedttvedt Member
    No, I believe everything is setup correctly. I rebuilt the Berkeley DB 4.2.52 several months ago when I installed Ice 1.5.1 and the 4.2.52 jar file is in my classpath.


    Here is my environment
    $ echo $CLASSPATH
    /opt/db-4.2.52/lib/db.jar:/home/tvedt/Ice_source/IceJ-2.0.0/lib/Ice.jar

    $ ls -la /opt/db-4.2.52/lib/db.jar
    -r--r--r-- 1 root root 157421 Sep 2 14:58 /opt/db-4.2.52/lib/db.jar

    $ ls -la /home/tvedt/Ice_source/IceJ-2.0.0/lib/Ice.jar
    -rw-r--r-- 1 tvedt software 702464 Nov 20 08:01
    /home/tvedt/Ice_source/IceJ-2.0.0/lib/Ice.jar

    $ echo $LD_LIBRARY_PATH
    /opt/db-4.2.52/lib:/opt/Ice-2.0.0/lib


    Here is what I see when I run the tests
    $python allTests.py

    *** running tests in ./test/Ice/operations
    tests with regular server.
    starting server... ok

    ... (all tests report ok until Freeze)

    *** running tests in ./test/Freeze/dbmap
    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:1491)
    . at java.lang.Runtime.loadLibrary0(Runtime.java:788)
    at java.lang.System.loadLibrary(System.java:834)
    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.ConnectionI.<init>(ConnectionI.java:109)
    at Freeze.Util.createConnection(Util.java:33)
    at Client.run(Client.java:201)
    at Client.main(Client.java:585)
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    The Java API of Berkeley DB is written using JNI.

    > Exception in thread "main" java.lang.UnsatisfiedLinkError: no db_java-4.1 in java.library.path

    This means Berkeley DB is trying to load the 4.1 version of the C Berkeley DB/Java library. Only the 4.1 db.jar does this.

    Cheers,
    Bernard
  • tvedttvedt Member
    You are correct. There was an older version of db.jar in my jre/lib/ext directory. My apologies!!!
Sign In or Register to comment.