MyEclipse: java.lang.UnsatisfiedLinkError: no db2jdbc [Closed]

mclarry - Aug 30, 2004 - 05:23 PM
Post subject: java.lang.UnsatisfiedLinkError: no db2jdbc [Closed]
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
support-rkalla - Aug 30, 2004 - 05:33 PM
Post subject:
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.
mclarry - Aug 30, 2004 - 06:57 PM
Post subject:
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
support-rkalla - Aug 30, 2004 - 07:10 PM
Post subject:
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.
sully74 - Feb 01, 2005 - 08:22 PM
Post subject: Struggling with similar issue
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
support-rkalla - Feb 01, 2005 - 09:01 PM
Post subject:
Quote:

DB2CLI.dll

Where does this file live? Make sure to append it to your LIbrary Path.
sully74 - Feb 01, 2005 - 09:40 PM
Post subject:
My DB2CLI.dll is in my
Code:
c:\program files\sqllib\bin
directory which I'd added to my Tomcat 4's library path when I first encountered the
Code:
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.
sully74 - Feb 01, 2005 - 09:58 PM
Post subject: Additional message
My DB2CLI.dll is in my
Code:
c:\program files\sqllib\bin
directory which I'd added to my Tomcat 4's library path when I first encountered the
Code:
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:

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

support-rkalla - Feb 01, 2005 - 09:58 PM
Post subject:
Hmm, can you try adding the file itself to the library path, not the dir?
support-rkalla - Feb 01, 2005 - 10:01 PM
Post subject:
Quote:

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.
sully74 - Feb 01, 2005 - 11:15 PM
Post subject:
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!
support-rkalla - Feb 02, 2005 - 12:34 AM
Post subject:
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?
sully74 - Feb 02, 2005 - 03:31 PM
Post subject:
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!
support-rkalla - Feb 02, 2005 - 03:53 PM
Post subject:
Quote:

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!
All times are GMT - 6 Hours
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits