facebook

java.lang.UnsatisfiedLinkError: no db2jdbc [Closed]

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #213967 Reply

    mclarry
    Member

    Hi guys,
    I’m trying to use DB2 version 7 JDBC driver with MyEclipse tomcat 5.0 or/and resin 3.0 startup plug-in. When I start the server, it always crash when it tries to load the COM.ibm.db2.jdbc.app.DB2Driver.

    I’ve got a java.sql.SQLException: java.lang.UnsatisfiedLinkError: no db2jdbc in java.library.path

    But I’m sure the library (db2java.jar driver) is in the classpath! It is in Tomcat 5.0\common\lib and just to make sure, I also added it manually in the Plug-in configuration classpath (My eclipse app server preferences).

    Note that when I run resin or tomcat without MyEclipse plugin, the connection to the database works perfectly. I “googled” the exception and my feeling is that there’s a IBM dll that doesn’t initialize. Any ideas would be much appreciated.

    I’ve got Eclipse 3.8.1 with the quick fix 20040825 and the Application server is running on Windows XP.

    Regards,
    Larry

    #213971 Reply

    Riyad Kalla
    Member

    Larry,
    You are correct there is a DLL that you likely need to “Append to Library Path” on the Paths prefrences fro your app server connector.

    #213984 Reply

    mclarry
    Member

    Right!
    For those who will have the same problem:
    I added the SQL 7.x bin directory (in my case: C:\Program Files\SQLLIB\bin) to MyEclipse app server library path and it’s now working!

    What I found strange is that this \bin folder is already in my “PATH”system variable. <i>The plug-in should have access to that, no!???</i> Doesn’t seems like it…

    Many thanks,
    Larry

    #213988 Reply

    Riyad Kalla
    Member

    Larry,
    Thank you for posting back your solution it is very helpful for all our users.

    As far as the BIN dir being in your path, the “System Path” that Java uses to resolve DLL and native system resources is different than your path. So while it certainly has access to your path, it wasn’t looking there for the directory/resources.

    #224205 Reply

    sully74
    Member

    I was suffering from the same symptoms and found this post. But since I added the /SQLLIB/bin to my Tomcat 4’s library path, I started getting a javaw.exe popup dialog stating the message ‘This application has failed to start because DB2CLI.dll was not found. Re-installing the application may fix this problem’.

    Unfortunately, re-installing the db2 client didn’t solve the problem.

    Any thoghts?

    I’m running Eclipse 3.0.1 with MyEclipse 3.8.0

    #224209 Reply

    Riyad Kalla
    Member

    DB2CLI.dll

    Where does this file live? Make sure to append it to your LIbrary Path.

    #224212 Reply

    sully74
    Member

    My DB2CLI.dll is in my

    c:\program files\sqllib\bin

    directory which I’d added to my Tomcat 4’s library path when I first encountered the

    java.sql.SQLException: java.lang.UnsatisfiedLinkError: no db2jdbc in java.library.path

    message.

    Now I no longer get the UnsatisfiedLinkError, but get the DB2CLI.dll not found error.

    #224213 Reply

    sully74
    Member

    My DB2CLI.dll is in my

    c:\program files\sqllib\bin

    directory which I’d added to my Tomcat 4’s library path when I first encountered the

    java.sql.SQLException: java.lang.UnsatisfiedLinkError: no db2jdbc in java.library.path

    message.

    Now I no longer get the UnsatisfiedLinkError, but get the DB2CLI.dll not found dialog error. When the Eclipse gets control back, The following exception message is there:

    java.sql.SQLException: java.lang.UnsatisfiedLinkError: C:\Program Files\SQLLIB\bin\db2jdbc.dll: Can't find dependent libraries
    #224214 Reply

    Riyad Kalla
    Member

    Hmm, can you try adding the file itself to the library path, not the dir?

    #224215 Reply

    Riyad Kalla
    Member

    Can’t find dependent libraries

    Oh wait this is diff, the db2jdbc.dll likely needs more DLLs that live someplace else in the SQLLIB dir, look for those and add that dir as well to lib path. Also check maybe your Window’s system dir.

    #224219 Reply

    sully74
    Member

    I added every item from my system’s PATH definition to MyEclipse’s library path configuration and still no dice. If I run Tomcat outside of Eclipse/MyEclipse, it gets past the DB2 call successfully, however, I’d like to step through the code and debug it.

    Thanks!

    #224220 Reply

    Riyad Kalla
    Member

    Sully,
    There is something setup with your normal Tomcat install that is not being conveyed in your MyEclipse connector install. Did you customize your Tomcat startup scripts at all? We need to figure out what the difference is.

    Our of curiosirty, what are all the files that the db2 JDBC driver install, installs? Where do they go? Did you add all these dirs to your Library Path?

    #224277 Reply

    sully74
    Member

    Not sure what happened, but last night before I left, my setup wasn’t working. Without making any changes, except logging off, powering down last night and then rebooting and logging back in (plus a good nights sleep), all is well this morning.

    Thanks for your help!

    #224281 Reply

    Riyad Kalla
    Member

    Without making any changes, except logging off, powering down last night and then rebooting and logging back in (plus a good nights sleep), all is well this morning.

    I bet it had something to do with Windows library loading with the DLL… never the less, glad it is working!

Viewing 14 posts - 1 through 14 (of 14 total)
Reply To: java.lang.UnsatisfiedLinkError: no db2jdbc [Closed]

You must be logged in to post in the forum log in