Java openCV embebbed on Web App - eclipse

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.

Related

How do I link my '.lib' and '.dll' files in play framework?

I have my project in play framework (scala). For this project, I have already loaded jar file into the lib direcctory of my project. I don't know where to place the '.lib' and '.dll' files. Now I have them inside the lib directory and the project shows the following error:
RuntimeException: java.lang.UnsatisfiedLinkError: no facesdk in java.library.path
Can anyone guide me through this?
Is the .so / dll really in java.library.path ? If yes, are it's dependencies also present ?
Youn need to check where java.library.path points to, and make sure the OS is able to load the .so / dll and all of it's dependencies.

Setting up LWJGL 3.0 with Netbeans

Downloaded LWJGL 3.0 from lwjgl.org, which only had the lwjgl.jar file in the jar subdirectory. The native directory only has files like libglfw.so but no subdirectories at all (and certainly not native/windows).
Created a library LWJGL30 with the lwjgl.jar file.
Added it to my project's library. and to the Project Properties->Libraries->Compile and Run.
Set the JVM launch argument in Project Properties->Run to -Djava.library.path=C:\Users\Owner\Documents\lwjgl\native for the VM Options
Copied the HelloWorld example from the link
Then ran and I get this error:
Exception in thread "main" java.lang.NoClassDefFoundError: Could not
initialize class org.lwjgl.system.Library at
org.lwjgl.system.MemoryAccess.(MemoryAccess.java:22) at
org.lwjgl.system.Pointer.(Pointer.java:22) at
org.lwjgl.glfw.GLFW.(GLFW.java:594) at
mylwjgl.MyLWJGL.run(MyLWJGL.java:43) at
mylwjgl.MyLWJGL.main(MyLWJGL.java:140)
C:\Users\Owner\AppData\Local\NetBeans\Cache\8.1\executor-snippets\run.xml:53:
Java returned: 1 BUILD FAILED (total time: 7 seconds)
I have checked, double checked, triple checked as well as searching online for an answer as it should work but it does not. Any help would be appreciated.
This error occurs when LWJGL is unable to find the native files. Make sure java.library.path actually points to the directory with LWJGL's natives (which have extensions like .dll, .so and .dylib). Be careful with spaces in the path: You have to wrap the path in quotation marks or it won't work.
The issue was I was running the HelloWorld example using the Stable version of LWJGL 3.0. When I switched to the Latest version, everything worked as expected.

java.lang.NoClassDefFoundError: com.google.android.gms.gcm.GoogleCloudMessaging

I am trying to implement push notification for my app. i had set up the project in eclipse added google-play-services.jar in the java buildpath and checked it in order and export.so my app was working absolutely fine when i was doing registration with gcm and was getting the registration id from gcm too.but when i try to build my app from command line i am getting the below error
java.lang.NoClassDefFoundError: com.google.android.gms.gcm.GoogleCloudMessaging
i added the google-play-services.jar in the classpath so the code compiled without any issue but at runtime i am getting the above exception.looks like its not able to find the jar at runtime. how can i make the jar available at runtime also please help.
Go to configure build path -> order and export and select(check box) the packages(jars).
No matter what the build path contains in eclipse, it has nothing to do with an application. All the jars have to be added to the classpath.
I would use the following command to start the application after build:
java -cp google.jar;jarA.jar;jarB.jar;jarC.jar -jar application.jar
After the -cp option fill in the semicolon separated list of jars that you use.

Error in Eclipse about type indirectly referenced from required .class file

I'm having this exception with some stubs generateds by Axis2:
"The type org.apache.axiom.om.OMElement cannot be resolved. It is
indirectly referenced from required .class files"
I've been reading many posts, and trying to find a solution. What I've found so far is to add the apache tomcat 5.5 library to the build path. It removed the error in the java file, but then, when I to execute any java program inside the project, I got this error:
'Launching myApp' has encountered a problem Exception occurred
executing command line. Cannot run program "C:\Program
Files\Java\jdk1.5.0_22\bin\javaw.exe" (in directory
"D:\Digicel\workspace\Digicel\myClassSample"): CreateProcess error=87,
The parameter is incorrect
then if I remove the apache tomcat library from the build path, I can run the other java programs, but not the one mentioned initially.
Any thoughts about it?
Okay, I've found the cause of the problem with the help of a friend :)
The thing is that Eclipse is aware that one of my dependencies, depends of another library, and Eclipse is checking for it when it tries to build the code.
So, what I've done is try to check which jar file contains this library: " org.apache.axiom.om.OMElement".
I've googled it and found that it is "axiom-api-1.2.10.jar" and finally my file compiled with 0 errors.
He also explained to me that my original solution of adding the apache tomcat server library is adding all the jars that cames with apache tomcat (which is a big list), and probably there may have been a version conflict with my current list of added jars.
So, the fix was to find the appropriate jar and add it to the project.
This error can also occur when a indirect dependency has a corrupt jar file. This may be caused by problems at the public maven repository.
If this is the case removing the local maven repository to download fresh jar files will fix your problem:
rm -Rf ~/.m2/repository/{enter/path/to/broken/stuff}
Goto Maven >Update Maven project>checkmark the Force update >Then Run
..That error Will gone....

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.