Archived
This forum has been archived. Please start a new discussion on GitHub.
IceJ-Freeze test fails
Hi,
I am using Sun JDK 1.4.2-04 on a Pentium-III running Fedora Core 1. I have compiled the BDB-4.2.52 source with Java enabled, and later Ice-1.3.0 too.
The IceJ test for Freeze fails with the following output:
*** running tests in ./test/Freeze/dbmap
starting client... ok
Exception in thread "main" java.lang.UnsatisfiedLinkError: no db_java-4.2 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_javaJNI.<clinit>(db_javaJNI.java:36)
at com.sleepycat.db.DbEnv.<init>(DbEnv.java:1081)
at Freeze.SharedDbEnv.<init>(SharedDbEnv.java:231)
at Freeze.SharedDbEnv.get(SharedDbEnv.java:31)
at Freeze.ConnectionI.<init>(ConnectionI.java:113)
at Freeze.Util.createConnection(Util.java:38)
at Client.run(Client.java:206)
at Client.main(Client.java:501)
Can anyone please help me with this? The CLASSPATH is in order with "db.jar" and "Ice.jar" specified in its scope.
Regards,
Shantanu
I am using Sun JDK 1.4.2-04 on a Pentium-III running Fedora Core 1. I have compiled the BDB-4.2.52 source with Java enabled, and later Ice-1.3.0 too.
The IceJ test for Freeze fails with the following output:
*** running tests in ./test/Freeze/dbmap
starting client... ok
Exception in thread "main" java.lang.UnsatisfiedLinkError: no db_java-4.2 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_javaJNI.<clinit>(db_javaJNI.java:36)
at com.sleepycat.db.DbEnv.<init>(DbEnv.java:1081)
at Freeze.SharedDbEnv.<init>(SharedDbEnv.java:231)
at Freeze.SharedDbEnv.get(SharedDbEnv.java:31)
at Freeze.ConnectionI.<init>(ConnectionI.java:113)
at Freeze.Util.createConnection(Util.java:38)
at Client.run(Client.java:206)
at Client.main(Client.java:501)
Can anyone please help me with this? The CLASSPATH is in order with "db.jar" and "Ice.jar" specified in its scope.
Regards,
Shantanu
0
Comments
-
Hi,
You also need to have the directory containing libdb_java-4.2.so in your LD_LIBRARY_PATH, because BerkeleyDB's Java implementation is really just a thin JNI layer on top of the C implementation.
Take care,
- Mark0 -
now next error
Thanks for pointing that out, it was my fault - I had only changed /etc/ld.so.conf but the cache wasn't updated.
Now after correcting it, the following error displays:
*** running tests in ./test/Freeze/dbmap
starting client... ok
Exception in thread "main" java.lang.AssertionError
at Freeze.Map.containsKey(Map.java:182)
at Client.run(Client.java:229)
at Client.main(Client.java:501)
Regards,
Shantanu0 -
That's a very strange error. This assert verifies that Berkeley DB's Db.get() method return 0 when it does not return DB_NOTFOUND (see src/Freeze/Map.java line 182).
According to
http://www.sleepycat.com/docs/java/com/sleepycat/db/Db.html#get(com.sleepycat.db.DbTxn,%20com.sleepycat.db.Dbt,%20com.sleepycat.db.Dbt,%20int), it cannot return any other value (Freeze only uses BTREE databases).
First, I'd recommend to do rm dbmap/db/*, to eliminate any old corrupted database. If this does not solve the problem, could you edit Map.java to find out this "impossible" return value?
Cheers,
Bernard0 -
Deletion has no effect
Hi Bernard,
Deleting files from dbmap/db/* didn't help. I am going to look into it as you said.
This is a Freeze-specific test error with IceJ-1.3.0. I suppose this test passes with some of the other users who tried it.
Regards,
Shantanu0 -
Sucess when re-built
Hello Bernard,
Following your instruction, I inserted a System.println () to test the value of "rc" in Freeze/Map.java (line 182) and built it with Ant 1.6.1. Surprisingly "rc" euqualled 0 every time when it was not DB_NOTFOUND, i.e. assert (rc == 0) stood okay. Obviously, the test run was successful too.
Then I commented out the line that I had added, and the test passed again. In fact, the entire test ran okay and not only Freeze/dbmap. The point here to note is -- a rebuild of Ice.jar corrected the problem. When I compared the Ice.jar that comes pre-built with IceJ against the one that I built on my box, they are different. I have used Sun JDK 1.4.2-04 on a Pentium-III running Fedora Core 1 (with the stock kernel).
Sorry for the delay in this response -- I was busy with several things. I believe you'd like to check at your end if the JDK version (used for the build process) has anything to do with the earlier behaviour; could you please also let me know why it is so?
Regards,
Shantanu0 -
Hello Shantanu,
That's probably because the Ice.jar in the IceJ distribution was built with Berkeley DB 4.1.25.
See: http://www.zeroc.com/vbulletin/showthread.php?s=&threadid=492
Sorry for not pointing this out earlier!
Bernard0