Kinectproject with Nite Middleware and OpenNI throws Exceptions - java

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!

Related

Klockwork Error with dependency (SqliteAgent)

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.

JNI Error with Java1.8.0_112 and Apache POI

I have just installed Java1.8.0_112, both jdk and jre 64bit on my Windows 7 machine.
I am attempting to run one of my programs via a .bat file and am getting the following error:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/poi/ss/use
rmodel/Workbook
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetMethodRecursive(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.poi.ss.usermodel.Workbook
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)
... 7 more
I have uninstalled and reinstalled the jre and I have restarted my machine. I have made sure I am pointing to all the libraries needed.
What really baffles me is that this error is showing about the POI workbook, but I have all the apache libraries I need and their appropriate dependencies so I'm not sure why this is an issue. Like I said, runs like a charm in Netbeans on the jdk, but completely implodes when I run it on my desktop via .bat
The program runs just fine in the Netbeans8 environment, which is using the jdk of 1.8.0_112 and the JDK8 binary.
My .bat file is as follows, I've added line breaks for readability:
C:\jre1.8.0_112\bin\java -cp
"T:\Netbeans Projects\MatchReport\build\classes;
S:\ADSJava\Jars\lib\poi-3.15.jar;
S:\ADSJava\Jars\lib\poi-ooxml-3.15.jar;
S:\ADSJava\Jars\lib\poi-ooxml-schemas-3.15.jar;
C:\Users\Jessica\Desktop\lib\xmlbeans-2.6.0.jar;
S:\ADSJava\Jars\lib\dom4j-1.6.1.jar;
S:\ADSJava\Jars\lib\commons-io-2.5.jar;
S:\ADSJava\Jars\lib\junit-4.12.jar;
S:\ADSJava\Jars\lib\commons-codes-1.10.jar;
S:\ADSJava\Jars\lib\commons-collections4-4.1.jar;
C:\Users\Jessica\Desktop\lib\DataServer.jar;
C:\Users\Jessica\Desktop\lib\ucanaccess-3.0.4.jar;
C:\Users\Jessica\Desktop\lib\jackcess-2.1.3.jar;
C:\Users\Jessica\Desktop\lib\xbeans.jar;
C:\Users\Jessica\Desktop\lib\commons-logging-1.0.4.jar;
C:\Users\Jessica\Desktop\lib\hsqldb.jar;
C:\Users\Jessica\Desktop\lib\commons-lang-2.4.jar"
ads.ADSMatchReport2
"Toyota Of Turnersville Control.txt" 2>&1> MatchReportResults.txt
Any help or guidance would be greatly appreciated, thank you!
Found the solution. The .bat file did not like me having libraries on mixed drives. Moving all the libraries to either my C: or the network S: drive solved the issue.
For whatever reason Netbeans was able to handle libraries in multiple locations but the .bat file does not.

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

Trying to make java application (Executable Jar) that uses OpenCV portable. Getting unsatisfied link error

I have made a application to grab video from a webcam and detect motion using OpenCV and JavaCV. I am trying to export as an executable jar using eclipse. The program runs fine in eclipse as does the exe jar on the computer I coded the program on.
What I am trying to accomplish is to make the exe Jar run on computers that don't have OpenCV installed. Basically what I would consider a portable application. When I run the exe jar on a different computer that has nothing installed other than the JRE I get unsatisfied link errors seen below.
Exception in thread "Video Thread" java.lang.UnsatisfiedLinkError: C:\Users\JohnD\AppData\Local\Temp\javacpp91062429652918\jniopencv_core.dll: Can't find dependent libraries
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.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:566)
at com.googlecode.javacpp.Loader.load(Loader.java:489)
at com.googlecode.javacpp.Loader.load(Loader.java:431)
at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:136)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.googlecode.javacpp.Loader.load(Loader.java:453)
at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:97)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.googlecode.javacpp.Loader.load(Loader.java:453)
at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:85)
at com.googlecode.javacv.OpenCVFrameGrabber.start(OpenCVFrameGrabber.java:174)
at VideoPanel.run(VideoPanel.java:163)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: no opencv_core244 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:593)
at com.googlecode.javacpp.Loader.load(Loader.java:481)
... 13 more
I have looked for a solution to what I am doing wrong. Most of the topics I have come across with unsatisfied link errors like the ones I am receiving have been trying to get it to run the first time through within there IDE, which is not the case here. I would think my dependencies are correct in the libraries in the build path since I can get it to run perfectly when I am on the computer that has everything installed but I still believe I am doing something wrong with the build.
Again I am trying to make it so the Jar can run on computers where OpenCV/JavaCV is not installed. Any help would be greatly appreciated.
If opencv is not installed in the target machine, than you need to deliver the necessary opencv's dll file and set the corresponding library path, opencv is a precondition of javacv
for example:
jar yourapp.jar -Djava.library.path="/path/to/OpenCV/library"
also check this answer

Java Exception when Switching from XP to WIN2K

I have an application that uses JNI for some native functions that are in a DLL. The application runs correctly on windows XP, however when I run the program on Window 2000, I receive the following:
java.lang.UnsatisfiedLinkError: C:\Program Files\Compunetix\stixDlls\CMSCI Dll.d
ll: The specified procedure could not be found
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.compunetix.vsd.stix.main.Main.main(Main.java:165)
Any ideas?
Thanks
it might be that the dll uses another dll that is not available in that second machine. Use Dependency walker/ to find exactly what dll is missing.

Categories

Resources