1 Reply Latest reply on Jan 21, 2013 2:07 PM by 981119

    Problems loading Berkeley (db5) on Centos 32 bits

      Hi everyone !!!

      The main problem is that CentOS have, by default, db4 in his repository but I need db5, to resolve this issue I have installed and compiled Berkeley 5.3.21 on Linux CentOS with the follow steps:

      Download db-5.3.21.zip
      I accessed to build_unix and made ../dist/configure & make & make install

      Now in this point I tried to run a app java through this command: # java -Djava.library.path=/usr/local/BerkeleyDB.5.3/lib -jar appdb.jar
      which -Djava.library.path=/usr/local/BerkeleyDB.5.3/lib is the path where is installed BerkeleyDB 5 and appdb.jar is the app in java

      BUT I have the follow error:
      Caused by: java.lang.UnsatisfiedLinkError: no db_java-5.3 in java.library.path
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
      at java.lang.Runtime.loadLibrary0(Runtime.java:840)
      at java.lang.System.loadLibrary(System.java:1047)
      at com.sleepycat.db.internal.db_javaJNI.<clinit>(db_javaJNI.java:52)
      at com.sleepycat.db.internal.DbEnv.<init>(DbEnv.java:351)
      at com.sleepycat.db.EnvironmentConfig.createEnvironment(EnvironmentConfig.java:4316)
      at com.sleepycat.db.EnvironmentConfig.openEnvironment(EnvironmentConfig.java:4272)
      at com.sleepycat.db.Environment.<init>(Environment.java:98)
      at ve.gov.cne.remesa.bdb.db.ReferenceDB.<init>(ReferenceDB.java:62)
      at ve.gov.cne.remesa.bdb.db.CitizenDB.<init>(CitizenDB.java:14)
      at ve.gov.cne.remesa.bdb.test.Principal.main(Principal.java:64)

      I put the db-5.3.21.jar in Javahome/jre/lib/ext and the results were same
      I tried to install by console the db5 .rpm but is a mess

      What can I do??? I hope your feed back, thank you in advance, sorry for my english
        • 1. Re: Problems loading Berkeley (db5) on Centos 32 bits
          NOT EVEN A MESSAGE!!!

          Finally my question has been solved I noticed a mistake in the installation.
          All steps to install Berkeley DB on CentOS are descriptive next:

          Download db-5.3.21.zip from Oracle link

          Access to build_unix file

          NOW !!! Compiling BerkeleyDB I should put options "--prefix=/usr/local" to describe path of instalation and "--enable-java" to enable java and create libdb_java libraries, in the end ypu should have a command like this
          ../dist/configure --prefix=/usr/local

          (More information http://www.linuxfromscratch.org/blfs/view/svn/server/db.html)

          Make a Symbolic link from lib/ext to BerkeleyDB file install, for instance:
          # ln -n /JREHOME/lib/ext/db.jar BERKELEYINSTALLFILE/db.jar

          Congratulation for myself, YEP!!!!