Welcome Guest! To access all forums & features, please register an account or sign-in. → Why register?



Problem with JDBC driver, tomcat 7 and java.library.Path under centos 6


1 reply to this topic - - - - -

#1 stavrinc

    Neowinian

  • 2 posts
  • Joined: 01-August 12

Posted 07 August 2012 - 21:23

At what path I must copy the file dbjodbc12.so? What is the correct configuration?

How I can configure the java.library.path under under centos 6 and tomcat 7 in order to fix the problem?

Please help me. If you have any answers please also email me to stavrinc@gmail.com

Thanks in advance

The connection string is as follows:

"jdbc:ianywhere:driver=libdbodbc12.so;ENG=host;DBN=database"
But when running the program, I get the following exception (with the relevant stack trace) -
Exception in thread "main" java.lang.UnsatisfiedLinkError: no dbjodbc12 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
at ianywhere.ml.jdbcodbc.IDriver.try_load(IDriver.java:247)
at ianywhere.ml.jdbcodbc.IDriver.<clinit>(IDriver.java:216)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)


#2 ichi

    Akihabara Style

  • 4,072 posts
  • Joined: 20-December 04

Posted 08 August 2012 - 12:42

It should be in java.library.path. You can run this to see what's the actual directory (or directories) for that:

String property = System.getProperty("java.library.path");
StringTokenizer parser = new StringTokenizer(property, ";");
while (parser.hasMoreTokens()) {
    System.err.println(parser.nextToken());
    }

Also you can add the currect location of that library to the java.library.path when launching your app:


java -Djava.library.path=".:/path/to/the/library" yourApp