I am trying to deploy an opencv java application with opencv 2.49, I have build the libopencv_java249.so and opencv-249.jar in the Ubuntu server and these are available in the class path when the application starts.
But it's throwing a exception saying libopencv_java245 not found, so initially I was under a impression that it's referring to a wrong opencv version. so to verify this I have removed the libopencv_java249.so from class path and then it was complaining that libopencv_java249 not available.
As an additional testing I also renamed libopencv_java249.so to libopencv_java245.so then it was saying again that opencv_java249 not found.
With this I guess we can confirm that it looks for the right version of opencv (that is libopencv_java249) but in addition to that it aslo requires libopencv_java245 also. Is my assumption is correct, it would be really helpful if someone can guide me.
Related
I'm trying to use JRuby in projects created in Android studio. I have built the latest (as of 9/10/2014) JRuby, and have completely updated Android Studio. I have a working app that I can use to test. I have a copy of jruby.jar in the MyApp/app/libs directory. Once there I right-clicked on jruby.jar and selected "Add as Library", which presumably did something (though what I am not certain), and have added the line "compile files('libs/jruby.jar')" to the build.gradle that is in MyApp/app/.
In one of the class files I have "import org.jruby.embed.ScriptingContainer;", which Android Studio says is fine (if I hadn't added jruby.jar as a library I couldn't include this without an error). Then in one of the working methods I say "ScriptingContainer container = new ScriptingContainer();". When I run this method the app will crash. I won't try to include the whole error message, but the important part seems to be:
Caused by: java.lang.ExceptionInInitializerError
at org.jruby.embed.internal.AbstractLocalContextProvider.<init>(AbstractLocalContextProvider.java:42)
at org.jruby.embed.internal.SingletonLocalContextProvider.<init>(SingletonLocalContextProvider.java:88)
at org.jruby.embed.ScriptingContainer.getProviderInstance(ScriptingContainer.java:248)
at org.jruby.embed.ScriptingContainer.<init>(ScriptingContainer.java:228)
at org.jruby.embed.ScriptingContainer.<init>(ScriptingContainer.java:185)
and
Caused by: java.lang.RuntimeException: unsupported Java version: 0.9
at org.jruby.RubyInstanceConfig.initGlobalJavaVersion(RubyInstanceConfig.java:1858)
at org.jruby.RubyInstanceConfig.<clinit>(RubyInstanceConfig.java:1608)
At least, those are the parts that make sense to me. I hav no idea why I would get the error "java.lang.RuntimeException: unsupported Java version: 0.9", since I am using 1.8.0_20. The rest of the errors I cannot follow. When I click on any of the files giving me an error (say AbstractLocalContextProvider.java:42) Android Studio will show the file but also say "Sources not found". That could be the problem, but I don't know why it can't find the sources.
Thanks for any help,
Brian
Uwe Kubosch (#donv70) was able to tell me the solution to this via Twitter, so credit to him, but I wanted to post the solution here in case anyone else needs it.
It was Java version that was causing the problem. In Ruboto the problem is solved here: https://github.com/ruboto/ruboto/blob/master/assets/src/org/ruboto/JRubyAdapter.java#L137
and for use in Android Studio it is necessary only to include the line: System.setProperty("jruby.bytecode.version", "1.6");
The number of course can be 1.6, 1.7, or 1.8, depending on your version of Java.
Looks like an interoperability problem between JRuby and the Dalvik VM (don't forget that you're running against Dalvik, not the Java VM).
There's a bug report at http://jira.codehaus.org/browse/JRUBY-5774 that may lead you in the right direction.
It's kind of old, and is marked 'fixed', but maybe it'll provide some clues?
I'm having this issue with an app I have written for a Scanner running windows mobile 5.0. I have no idea what it means, can anyone with some Java Cre-Me, windows mobile experience lend some assistance please??
Error given on execution:
java.lang.UnsatisfiedLinkError: no SymbolJavaApi in java.library.path
at java.lang.ClassLoader.loadLibraryInternal()
at java.lang.ClassLoader.loadLibrary()
at java.lang.Runtime.loadLibrary0()
at java.lang.System.loadLibrary()
at
at com.vmt.plugins.symbol.barcodescanner.services.ScannerImplementation.read()
at com.vmt.plugins.symbol.barcodescanner.ScannerPlugin.invoke()
at ScannerTest.startScanning()
at ScannerTest.createwindow()
at ScannerTest.main()
For UnsatisfiedLinkError, the JDK states:
Thrown if the Java Virtual Machine cannot find an appropriate
native-language definition of a method declared native.
That means that there is a method inside ScannerImplementation.read() that is a native call definition that it can't in the java.library.path or any system defined libraries.
What this means is that the DLL that is needed for your ScannerImplementation isn't registered in the Java LIB path and thus the JVM can't do a native call.
I hope this helps.
The Java class loader tries to access the Symbol API but can not find the required libraries in the given library path.
On a desktop system I'd say you need:
Either extend the class path accordingly or
Copy missing external DLLs to the path where your application resides
I'm sure that Symbol/Motorola has some examples where you can see how to do that - maybe you need to install the classes to the device first using a CAB file.
I'm coming from a .NET background and for that, there's a Symbol API CAB file which installs required DLLs to the device.
I am working in a "biggish" Maven/Java project and cannot make sense of an error I am getting when running the app (it compiles OK). The error code I get is:
java.lang.NoClassDefFoundError: Could not initialize class com.sun.management.OperatingSystem
at com.sun.management.OSMBeanFactory.getOperatingSystemMXBean(OSMBeanFactory.java:30)
at sun.management.ManagementFactory.getOperatingSystemMXBean(ManagementFactory.java:100)
at sun.management.ManagementFactory.createPlatformMBeanServer(ManagementFactory.java:308)
at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:504)
at com.sun.xml.internal.ws.server.JMXAgent.<init>(JMXAgent.java:49)
at com.sun.xml.internal.ws.server.JMXAgent.getDefault(JMXAgent.java:77)
at com.sun.xml.internal.ws.server.WSEndpointImpl.<clinit>(WSEndpointImpl.java:84)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
From the look of it, it seems the VM is not finding the "com.sun.management.OperatingSystem" class, but after googling around I cannot find out where is that class supposed to be located.
Any hints?
EDIT: Running with JRE JDK 1.6.0_18 (JAVA_HOME=C:\Program Files\Java\jdk1.6.0_18)
It might not be what's causing your problem, but errors like the one you are seeing can sometimes occur when the JDK is stored under "Program Files". Java doesn't like spaces in the filesystem path.
com.sun.management is an undocumented java package. The class OperatingSystem is the implementation for the OperatingSystemMXBean. If you download the Javasource code you will be able to see the class there.
As far as the location of this file, it should be in your standard JRE package. Make sure your application is pointing to the proper JRE. In Java 5/6, the class can be found in the rt.jar file.
If you want to confirm the file is there, Open the jar in program like JD-Gui and have a look around the Jar to confirm.
Looking at the javadocs for Java 6 and 7, it appears that OSMBeanFactory (which is in your stack trace) was added in 7.
Monitoring and Management Interface for the Java™ Platform (6)
Monitoring and Management Interface for the Java™ Platform DRAFT ea-b120 (7)
I've created a GWT project using Eclipse which was working perfectly (I was able to run it in both Hosted Mode and on Google App Engine) until I tried to import the Gears API for Google Web Toolkit. After adding the following line to my java source file:
import com.google.gwt.gears.client.geolocation.Geolocation;
I get the following error when I try to compile:
19-Jun-2009 3:36:09 AM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed com.google.apphosting.utils.jetty.DevAppEngineWebAppContext#1c7d682{/,C:\Documents and Settings\Geoff Denning\workspace\TaskPath\war}
javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
I've already added the gwt-gears.jar file to my \war\WEB-INF\lib directory, and I've referenced it in Eclipse as follows:
I've even opened the gwt-gears.jar file and confirmed that org/apache/xerces/jaxp/SAXParserFactoryImpl.class does exist. Can anyone give me any pointers as to why I'm getting the above error?
Check that Xerces exists in:
$JAVA_HOME/lib/endorsed
Sounds like a Java 5 issue. Also check the Java system property for:
javax.xml.parsers.SAXParserFactory
It should be:
org.apache.xerces.jaxp.SAXParserFactoryImpl
If not then that's your issue, make sure you set the system property.
Apparently this is a bug in jre 1.5. I was able to resolve the problem by switching my default JRE in Eclipse from 1.5.0_06 to 1.6.0_03, as shown below:
Thanks to Jon and Rahul for pointing me in the right direction.
This happened to me. I had conflicting JARs in my workspace. I removed one and boom it worked. The message didn't lend very well to the root of the error.
My SAXParserFactoryImpl problem was caused by gwt-gadgets.jar I had in my boot class path. Removing this JAR from the boot class path solved the problem for me. Basically you have to remove any JAR containing a SAXParserFactoryImpl class from your build path (user libs).
Remove the $JAVA_HOME/jre/lib/jaxp.properties fixed the issue.
Take a look at Trouble with Selenium (XercesImpl) and Google App Engine.
I had a similar problem with GWT / GAE (SAXParserFactoyImpl not found) and solved it by;
Importing the jar to war/WEB-INF/lib
Adding the jar to the build path
I have a pci-modem in my laptop and I tried to run a program that opens the port and configures it.I get an excepcion while doing it, I think that it can't see the port, even though it is on COM3. Is there any way of doing it in java?
The error I get is noClassDefFoundError. It says the SerialPortEventListener class isn't found. I'm using rxtxcomm. I tried using javax.comm but it doesn't find the port either.
Thanks a lot
A NoClassDefFoundError indicates that you're missing a JAR file from your classpath, specifically the one that is holding SerialPortEventListener class. Check your classpath.
Have you followed the installation instructions for rxtxcomm ? Note you have to handle a library and a jar file. You need to specify a system library path for the native component.
You may find that you get the 'no class def found' if the appropriate .jar is found, but it can't find the corresponding native library to load.