Klockwork Error with dependency (SqliteAgent) - java

Good afternoon,
I am trying to add the klockwork plugin in QNX (eclipse based) which is using Java 1.6 version (It is needed this version). I have Klockwork version 9.6 installed. But I have some problems.
The results on the internet say that we need to add a variable in the system: _JAVA_OPTIONS = -Djava.net.preferIPv4Stack=true but it still doesn't work.
When I look for something about sql in the Klockwork installation folder, there is a file called sqlite_jni . But it is strange that it does not work because of a dependency on Klockwork when Klockworks desktop works fine.
When I execute eclipse with debug mode enabled, It shows these errors:
Exception in thread "Thread-3" 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.(SqliteAgent.java:21) at com.klocwork.inforceeclipse.problems.LocalProblemsStorage.readProblemUpdates(LocalProblemsStorage.java:95) at com.klocwork.inforceeclipse.problems.AbstractProblemsStorage.reloadProblems0(AbstractProblemsStorage.java:186) at com.klocwork.inforceeclipse.problems.AbstractProblemsStorage$1.run(AbstractProblemsStorage.java:159) at java.lang.Thread.run(Unknown Source)
WARN : [com.klocwork.licensing.LibInfo:41]: Could not determine library path:
ERROR: [com.klocwork.licensing.FlexLicenseServer:92]: Warning: Cannot find valid loccounter (loccounter.dll) Exception in thread "Thread-13" java.lang.NoClassDefFoundError: Could not initialize class com.klocwork.desktopdb.SqliteAgent at com.klocwork.inforceeclipse.problems.LocalProblemsStorage.readProblemUpdates(LocalProblemsStorage.java:95) at com.klocwork.inforceeclipse.problems.AbstractProblemsStorage.reloadProblems0(AbstractProblemsStorage.java:197) at com.klocwork.inforceeclipse.problems.AbstractProblemsStorage$1.run(AbstractProblemsStorage.java:159) at java.lang.Thread.run(Unknown Source)
And also It appears this dialog:
Database dialog error
Best regards and thanks in advance!

The first thing is that klockwork is compatible with QNX 32 bits.
Secondly, the klockwork lib should be added to the path:_ Klocwork\USERX\lib\ix86-pc-win32.
That's all!
Thanks.

Related

NoSuchMethodError: <init> in com.sun.glass.ui.win.WinApplication.staticScreen_getScreens

Since upgrading to install4j 7.0.5 and Java 10, users that run our application on Windows more and more often report that the application throws
java.lang.NoSuchMethodError: <init>
at javafx.graphics/com.sun.glass.ui.win.WinApplication.staticScreen_getScreens(Native Method)
at javafx.graphics/com.sun.glass.ui.Screen.initScreens(Unknown Source)
at javafx.graphics/com.sun.glass.ui.Application.lambda$run$1(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
UiLauncher (WAITING)
at java.base#10.0.1/jdk.internal.misc.Unsafe.park(Native Method)
at java.base#10.0.1/java.util.concurrent.locks.LockSupport.park(Unknown Source)
at java.base#10.0.1/java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(Unknown Source)
at java.base#10.0.1/java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(Unknown Source)
at java.base#10.0.1/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(Unknown Source)
at java.base#10.0.1/java.util.concurrent.CountDownLatch.await(Unknown Source)
at platform/javafx.graphics#10.0.1/com.sun.javafx.tk.quantum.QuantumToolkit.startup(Unknown Source)
at platform/javafx.graphics#10.0.1/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
at platform/javafx.graphics#10.0.1/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
at platform/javafx.swing#10.0.1/javafx.embed.swing.JFXPanel.initFx(Unknown Source)
at platform/javafx.swing#10.0.1/javafx.embed.swing.JFXPanel.<init>(Unknown Source)
at java.base#10.0.1/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base#10.0.1/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at java.base#10.0.1/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.base#10.0.1/java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.base#10.0.1/java.lang.Class.newInstance(Unknown Source)
at app//...
when starting the application though the install4j created exe file. The error is triggered by creating an instance of javafx.embed.swing.JFXPanel through reflection:
Class.forName("javafx.embed.swing.JFXPanel").newInstance();
We currently suspect that for some reason an incompatible DLL is loaded (glass.dll seems to contain the native method mentioned in the stacktrace).
Does anyone know how to prevent this error? E.g. is there are way to restrict the java.library.path used when executing the application through the install4j-generated exe to the Java runtime environment that was embedded in the installer and installed locally with the application?
According to one user, the error does not occur if the application is started "manually" using the
java -jar app.jar
command. So it seems the problem lies with the install4j created executable.
The workaround to this problem seems to be to remove all occurences of "glass.dll" from your system %PATH%.
I believe a fix must be implemented somewhere else, though; either in the Java runtime or in the Install4j code, but cannot be implemented in the Java code of the actual app:
For some reason the Java runtime version in Install4j checks the bundled JRE last when locating the libraries. In this case the problematic native library is glass.dll which should contain the requested <init> method but if anywhere in your %PATH% there is an older, incompatible version of glass.dll (e.g. from a previous Java 8 installation) that file will be loaded with a higher precedence and then the application will crash natively.
This is not a problem in the code of the application (the java code), nor a problem with the bundled JDK, this is a problem of how the install-4j-generated exe files (or maybe Java internally) tries to resolve native dlls. Instead of checking all path elements first, it should be checking the bundled JRE directory, first.
With Procmon you can see that it loads arbitrarily placed glass.dll files in the path, first: I added one from JDK 1.8 into one of my path elements and got this (plus the crash):

How to remove this Exception "Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopencv_objdetect in java.library.path"

I'm working on Face Recognition Project by using OpenCV 2.4.9, JavaCV 0.7,JAVA version 8 and Eclipse IDE... I am getting these Exceptions continuously.. Is there something wrong in the follwoing code? It's not my complette code...
Please Someone help me as soon as possible...
import com.googlecode.javacpp.Loader;
import com.googlecode.javacv.cpp.opencv_objdetect;
Loader.load(opencv_objdetect.class);
Exceptions:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopencv_objdetect 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.googlecode.javacpp.Loader.loadLibrary(Loader.java:711)
at com.googlecode.javacpp.Loader.load(Loader.java:586)
at com.googlecode.javacpp.Loader.load(Loader.java:540)
at com.googlecode.javacv.cpp.opencv_objdetect.<clinit>(opencv_objdetect.java:91)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.googlecode.javacpp.Loader.load(Loader.java:561)
at FaceRecognizer.<init>(FaceRecognizer.java:56)
at FaceRecognizer.main(FaceRecognizer.java:112)
Caused by: java.lang.UnsatisfiedLinkError: C:\Users\XYX\AppData\Local\Temp\javacpp183187286948746\jniopencv_objdetect.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:700)
... 8 more
This page gives a description of how to get an OpenCV Java sample running. There should be two things that you need to do:
You need to call System.LoadLibrary specifying the OpenCV DLLs that it uses
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
Make sure the DLL in somewhere where it can be found by the JVM. There are a few ways if doing that. I don't use Eclipse but this seems to give a good explanation. Alternatively, a simple bodge just to get things working is to drop the DLL into the windows\system32 directory
Finally there may be an issue if you are running a 64 bit JVM but trying to use a 32 bit DLL. If you are still having trouble make sure you are using matching JVM and DLL.
It looks like one of the java libraries that you are using in your project is using jni calls that uses dll files. Do you have the library installed correctly? It looks like it is called opencv or something that is related to jniopencv_objdetect.dll

GLPK java java.lang.UnsatisfiedLinkError: Can't find dependent libraries

The dynamic link library for GLPK for Java could not be loaded.
Consider using
java -Djava.library.path=
The current value of system property java.library.path is:
\\MILP\lib\glpk-4.55\w64
Exception in thread "main" java.lang.UnsatisfiedLinkError:
\\MILP\lib\glpk-4.55\w64\glpk_4_55_java.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.gnu.glpk.GLPKJNI.<clinit>(GLPKJNI.java:24)
at org.gnu.glpk.GLPK.glp_version(GLPK.java:2259)
at TestMain.main(TestMain.java:7)
I have added the correct JAR file
I have given the correct native path for the library
Still the problem persists,
One doubt I have is that the \MILP\lib\glpk-4.55\w64\glpk_4_55_java.dll file is flawed. I checked it using dependencyWalker there it shows some warnings
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
Any leads would be appreciated
I also faced same issue. I copied glpk_4_55.dll and glpk_4_55_java.dll to C:\Windows\System32 and Everything works fine for me.
You can add the C:\Program Files\GLPK\glpk-4.55\w64 folder to your PATH environment variable
or
copy the glpk_4_55.dll and glpk_4_55_java.dll to C:\Windows\System32 as suggested by Pradeepb

Lauch Eclipse SWT window application from command line error

First off. I am a newbie and green with respect to Java programming.
I created a Java Eclipse "SWT" "Application Window" on a Eclipse Kepler 4.3.1 (32-bit) running WindowBuilder and SWT (swt.jar). The design view is a composite.
The java application runs fine from Eclipse. I simply press the play button and presto.
Problem:
Issuing
java -cp . PkgNetAccelerator32.netAcceleratorApp
yields the following error message:
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Composite
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Composite
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more
I was doing some research and several posts on other issues suggested that the cure is to create a manifest. I saw an article that said something like:
Select the src folder, right click and select export, then Java, then JAR file, specify Manifest.jar and a path on the folder, make sure the "Generate the manifest file" is selected, and press finish.
I created the manifest file and tried launching it with the following command line:
java -jar ../Manifest.jar -cp . PkgNetAccelerator32.netAcceleratorApp
That yielded the same error message above.
I saw another article that said that one should add in the swt.jar file, but that is taken care of by the manifest. No? Specifying "swt.jar" instead of the manifest that I created resulted in an error message:
no main manifest attribute, in ../swt.jar
That error message makes sense.
I am at a loss. How do I run the java application?
I am testing on my Windows 7 Professional 64-bit desktop, but I need to run on CENTOS too. That should be no problem, as I assume whatever the fix on Windows is, will work on CENTOS.
UPDATE:
I placed the two lib files in a /lib folder to match the answer given. I then issued the following command line and got the following error message.
C:\SoftDev\Projects\NetAccelerator\JavaWorkspace\NetAccelerator32>java -cp "bin/*;lib/*" PkgNetAccelerator32.netAcceleratorApp
Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
at PkgNetAccelerator32.netAcceleratorApp.open(netAcceleratorApp.java:43)
at PkgNetAccelerator32.netAcceleratorApp.main(netAcceleratorApp.java:33)
I found the following article, which produces a command line that works, just that is not reasonable for sending. I much rather use the answer.
Lets assume you have a eclipse project structure similar to this:
Workspace
-> Project
-> src (source code directory)
-> bin (compiled byte code directory as JAR)
-> lib (jar directory)
-> .classpath (eclipse file)
-> .project (eclipse file)
I am assuming that you are exporting the JAR as an executable JAR.
So in order to run a class in that exported JAR with another JAR from the lib directory (swt.jar) while your working directory is the Project directory you will need to execute:
java -cp "bin/*:lib/*" PkgNetAccelerator32.netAcceleratorApp
Using wildcards requires Java 6 or later
Please note: CENTOS requires : as a path separator. Windows uses a semi-colon.
This will add your classes and the swt classes onto the classpath and run your main class PkgNetAccelerator32.netAcceleratorApp
SWT 32bit vs 64bit
You will either need to use a 32bit JVM locally or continue to use a 64bit JVM and use the 64bit version of swt; see swt on windows 64 bit. I would suggest you match your version of your local JVM (32bit or 64bit) with the version that you will be running on the CENTOS machine. You will however need a different swt jar for CENTOS.

Kinectproject with Nite Middleware and OpenNI throws Exceptions

i have a problem with my Kinect. At the beginning i started only with OpenNI Samples, which works fine. Now i try to start with NITE and have some issues. If i run my code, Eclipse throws exceptions like this.
Started context generating...
Exception in thread "main" java.lang.NoSuchMethodError: Method com.primesense.NITE.NativeMethods.xnvMessageListener_RegisterActivate(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I not found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(Unknown Source)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.primesense.NITE.NativeMethods.<clinit>(NativeMethods.java:13)
at com.primesense.NITE.SessionManager.<init>(SessionManager.java:13)
at GestureDetect.configNITE(GestureDetect.java:108)
at GestureDetect.<init>(GestureDetect.java:59)
at GestureDetect.main(GestureDetect.java:484)
OpenNI and NITE jar Files added to the build path... but it doesn't works :-(
Problem solved! There is a incompatibility between the actual OpenNI and NITE Versions which can be downloaded from openni.org. OpenNI SDK v1.5.7.10 and NiTE v1.5.2.23 doesn't work together. Older versions are not available there :-(
The Solution is very simple. There is a all-around installer for OpenNI, NITE and SensorKinect, called ZigFuOpenNI. This Package included following versions.
OpenNI-Win32-1.3.2.3-Dev
NITE-Win32-1.4.1.2-Dev
SensorKinect-Win-OpenSource32-5.0.3.4
ZiFuOpenNi can be downloaded from
http://code.google.com/p/understanding-bones-kinect-exhibit/downloads/detail?name=ZigFuOpenNI.exe&can=2&q=
Works fine!

Categories

Resources