DB2 Native Library can't find libraries - db2

I have an application that depends on loading a db2 driver. I was getting weird errors that the db2jcct2.dll wasn't being loaded, so I made sure to add it to my lib path per: http://www-01.ibm.com/support/docview.wss?uid=swg21419978 and I also made sure it was added to java.library.path at program startup. After doing that I get the following error/stack trace.
com.ibm.db2.jcc.c.SqlException: Failure in loading T2 native library db2jcct2, reason: java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\IBM\SQLLIB\BIN\db2jcct2.dll: Can't find dependent libraries
at com.ibm.db2.jcc.t2.a.a(a.java:31)
at com.ibm.db2.jcc.t2.T2Configuration.<clinit>(T2Configuration.java:84)
at com.ibm.db2.jcc.t2.a.a(a.java:31)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:174)
at com.ibm.db2.jcc.t2.T2Configuration.<clinit>(T2Configuration.java:84)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:174)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:215)

Related

Klocwork plugin failed to run in eclipse with error "java.lang.UnsatisfiedLinkError: no sqlite_jni in java.library.path"

I just installed Klocwork plugin for Eclipse. But when I start to scan a project, it gives me the following error:
java.lang.UnsatisfiedLinkError: no sqlite_jni in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.klocwork.desktopdb.SqliteJniLoader.initDefaultLibraries(SqliteJniLoader.java:28)
at com.klocwork.desktopdb.SqliteAgent.<clinit>(SqliteAgent.java:21)
at com.klocwork.desktopdb.migration.MigrateDesktopDb.<init>(MigrateDesktopDb.java:48)
at com.klocwork.desktopdb.migration.MigrateDesktopDb.migrate(MigrateDesktopDb.java:44)
at com.klocwork.desktopdb.KwlpProblemsStorageUtil.migrateOrCreateStorage(KwlpProblemsStorageUtil.java:32)
at com.klocwork.kwcheck.commands.AbstractCommand.convertToDB(AbstractCommand.java:82)
at com.klocwork.kwcheck.commands.BuildCommand.execute(BuildCommand.java:110)
at com.klocwork.util.CommandLineParser2.parse(CommandLineParser2.java:360)
at com.klocwork.kwcheck.KwCheckMain.main(KwCheckMain.java:22)
kwcheck: WARNING: Exception occured in java application
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true -Djava.library.path=".;C:\Program Files (x86)\myLib\win32"
Exception in thread "main"
I found several threads with similar issues:
http://thelogofthewook.blogspot.de/2011/12/updating-problems-myproject-no.html
https://developer.klocwork.com/community/forums/klocwork-general/user-tools/eclipse-plugin-error
They all mentioned some 32bit/64bit issue. But I am using 32bit Eclipse + 32bit JVM.
And as I checked, there are 2 different sqlite_jni.dll files existing in the plugin's lib and lib64 folders respectively. So I guess no file is missing.
So what could be wrong?
Currently, I am trying to troubleshoot it in the following ways:
Figure out how a plugin locates its native libraries.
How to configure java.library.path for a plugin.
A little patience pays off...
I read carefully the error message and it clearly says:
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
-Djava.library.path=".;C:\Program Files (x86)\myLib\win32"
So I suddenly recall that I once set a environmental variable like this:
_JAVA_OPTIONS = -Djava.net.preferIPv4Stack=true -Djava.library.path=".;C:\Program Files (x86)\myLib\win32"
After I changed it to below, things begin to work.
_JAVA_OPTIONS = -Djava.net.preferIPv4Stack=true
And some background reference:
http://examples.javacodegeeks.com/java-basics/java-library-path-what-is-it-and-how-to-use/

Java openCV embebbed on Web App

I am using springMVC and Maven
I added as it as a user library
It give bellow error
HTTP Status 500 - Handler processing failed; nested exception is java.lang.UnsatisfiedLinkError: no opencv_java248 in java.library.path
enyone can help me
Thanks
You need to install the opencv_java248.so from OpenCV lib folder into your Java JVM lib folder to make it available runtime.
First check which JVM you actually use. JAVA_HOME is good starting point. Then copy the .so file into native library folder. The location varies, but in my case that was in:
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/
Notice the 'jre' part here. There is a lib folder also directly under jdk folder and it does not work from there at runtime.
Since you get this error, you are trying to load the library correctly in Java. Something like this is needed for that:
static {
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
}
Where org.opencv.core.Core is from opencv248.jar.

How fix sigar library when I run spray application?

I have a sbt project written in scala. The project uses akka and spray. There is a class with main function. When I run scala console application sometimes I get
[on-spray-can-akka.actor.default-dispatcher-4] [DEBUG] [2014-11-07 16:48:30,336] Sigar: no sigar-amd64-winnt.dll in java.library.path
org.hyperic.sigar.SigarException: no sigar-amd64-winnt.dll in java.library.path
I do not change anything run it again and it runs well. So it can be run successful or fail several times on end. How to fix this?
UPDATED
Also when it start normal there is a message:
[INFO] [11/07/2014 17:02:36.772] [on-spray-can-akka.actor.default-dispatcher-2]
[Cluster(akka://myApp)] Cluster Node [akka.tcp://myApp#127.0.0.1:2551] - Metrics will be
retreived from MBeans, and may be incorrect on some platforms. To increase metric accuracy
add the 'sigar.jar' to the classpath and the appropriate platform-specific native libary to
'java.library.path'. Reason: java.lang.IllegalArgumentException: java.lang.UnsatisfiedLinkError:
org.hyperic.sigar.Sigar.getPid()J
Sigar is a native library for gathering performance stats, used by Typesafe Console atmos Scala library. If you're not interested in hooking up Typesafe Console to your application, you can simply remove all references to atmos library from sbt build script and app config files without affecting your app functionality.

Wildfly CLI not working for me

All I did was download wildfly-8.1.0.CR2 and extract it. standalone.bat and add-user.bat work but jboss-cli.bat does not.
F:\wildfly-8.1.0.CR2\bin>jboss-cli
java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no jansi64-1.9 in
java.library.path, no jansi-1.9 in java.library.path, no jansi in java.library.path,
D:\pgarner\AppData\Local\Temp\jansi-64-1.9.dll: The application has failed to start
because its side-by-side configuration is incorrect. Please see the application event
log or use the command-line sxstrace.exe tool for more detail]
at org.fusesource.hawtjni.runtime.Library.doLoad(Library.java:184)
at org.fusesource.hawtjni.runtime.Library.load(Library.java:142)
at org.fusesource.jansi.internal.Kernel32.<clinit>(Kernel32.java:37)
at org.fusesource.jansi.WindowsAnsiOutputStream.<clinit>(WindowsAnsiOutputStream.java:52)
at org.jboss.aesh.terminal.WindowsTerminal.init(WindowsTerminal.java:53)
at org.jboss.aesh.console.Console.setTerminal(Console.java:193)
at org.jboss.aesh.console.Console.reset(Console.java:154)
at org.jboss.aesh.console.Console.<init>(Console.java:105)
at org.jboss.aesh.console.Console.<init>(Console.java:101)
at org.jboss.as.cli.impl.Console$Factory.getConsole(Console.java:85)
at org.jboss.as.cli.impl.Console$Factory.getConsole(Console.java:78)
at org.jboss.as.cli.impl.CommandContextImpl.initBasicConsole(CommandContextImpl.java:349)
at org.jboss.as.cli.impl.CommandContextImpl.<init>(CommandContextImpl.java:296)
at org.jboss.as.cli.impl.CommandContextFactoryImpl.newCommandContext(CommandContextFactoryImpl.java:76)
at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:273)
at org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:253)
at org.jboss.as.cli.CommandLineMain.main(CommandLineMain.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jboss.modules.Module.run(Module.java:312)
at org.jboss.modules.Main.main(Main.java:460)
Press any key to continue . . .
When I start up Wildfly using standalone.bat I see the following entry for java.library.path in server.log:
java.library.path = F:\Java\jdk1.7.0_45\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;F:\WANdisco\uberSVN\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;F:\GnuPG\pub;F:\7-Zip;"E:\WebTest\build\bin";F:\WANdisco\uberSVN\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;F:\GnuPG\pub;F:\7-Zip;.
The following file does indeed appear on my file system when I attempt to run jboss-cli:
D:\pgarner\AppData\Local\Temp\jansi-64-1.9.dll
I also tried using wildfly-8.0.0.Final instead of wildfly-8.1.0.CR2 and the same exact problem happened.
How to resolve this problem? I assumed the CLI should just work right out of the box after extracting all the files out of the zip file.
We're facing the same error and the problem is due to the jansi dll dependencies. In fact you need to install the Microsoft Visual C++ 2008 Redistributable Package corresponding to your platform. For x64, you can follow this link :
http://www.microsoft.com/en-US/download/details.aspx?id=2092
Have a similar problem. I can start Wildfly and deploy my application without errors, but everytime I redeploy my application, I get the following error:
Caused by:
java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no
jansi64-1.9 in java.library.path, no jansi-1.9 in java.library.path,
no jansi in java.library.path, Native Library
C:\Users\zb\AppData\Local\Temp\jansi-64-1.9.dll already loaded in
another classloader]
It seems this jansi library is stuck after deploy.
Restarting the server helps temporarily.

Eclipse VM Argument and external JAR file error

I just added "-Djava.library.path=" to the "VM Arguments" under Run Configuration in Eclipse and everything works fine until I tried to add an external JAR file. I get the following error:
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path
Am I not setting something properly in Eclipse?
If your interested I forked RXTXserial a while back since thier update "schedule" sucks. I have just ported it over to the Android platform too. We decided to move the native libs into the jar and use reflection to deploy them. The API is the same as RXTX, but everything just works. You can find jars and full project sources at:
http://code.google.com/p/nrjavaserial/
The exception indicates that the class gnu.io.RXTXCommDriver tries to load a native library, which would be named rxtxSerial.dll on Windows and rxtxSerial.so on Linux, and the JVM cannot find it in the directories listed in java.library.path. Have you tried to add a JAR containing the library to java.library.path? I don't think that's possible, it has to be a directory containing the extracted library file.
Appearently that external library has a dependancy with another class gnu.io.RXTXCommDriver
. Perhaps you will need to add that library to class path.