jloyd / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

java.lang.UnsatisfiedLinkError: getDeclaredAnnotations #74

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello Samuel,

hope you are doing well...   I've am trying to install on a rather (what I 
consider) eclectic piece of hardware - a Chumby 1 
(http://en.wikipedia.org/wiki/Chumby)  I successfully got a version of the 
JamVM & GNU Classpath working on it.  Now I'm a little flummoxed by an 
unsatisfied link error.

I've grepped and grepped but can't find the location (in source at least)

Do you use reflective Annotations?  I read in this post they aren't supported 
on Android - and I believe the Davlik JVM is very close to the JamVM. 

Do you have any ideas or any possible directions I might go in to investigate?

Regards,
Greg.

14899 [main] INFO org.myrobotlab.service.OpenCV  - starting capture
Exception in thread "OpenCV_videoProcessor" java.lang.UnsatisfiedLinkError: 
getDeclaredAnnotations
   at java.lang.VMClass.getDeclaredAnnotations(Native Method)
   at java.lang.Class.getDeclaredAnnotations(Class.java:1580)
   at java.lang.Class.getAnnotations(Class.java:1518)
   at java.lang.Class.getAnnotation(Class.java:1497)
   at com.googlecode.javacpp.Loader.appendProperties(Loader.java:101)
   at com.googlecode.javacpp.Loader.load(Loader.java:300)
   at com.googlecode.javacpp.Loader.load(Loader.java:266)
   at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:118)
   at java.lang.VMClass.forName(Native Method)
   at java.lang.Class.forName(Class.java:189)
   at com.googlecode.javacpp.Loader.load(Loader.java:286)
   at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:87)
   at java.lang.VMClass.forName(Native Method)
   at java.lang.Class.forName(Class.java:189)
   at com.googlecode.javacpp.Loader.load(Loader.java:286)
   at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:88)
   at org.myrobotlab.service.OpenCV$VideoProcess.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:710)

Original issue reported on code.google.com by supert...@gmail.com on 7 Jun 2011 at 9:23

GoogleCodeExporter commented 9 years ago
missing non support for Annotations @ Android link - 
http://code.google.com/p/android/issues/detail?id=16135

Original comment by supert...@gmail.com on 7 Jun 2011 at 9:48

GoogleCodeExporter commented 9 years ago
I'll try building and installing the latest version of JamVM and GNU classpath

Original comment by supert...@gmail.com on 7 Jun 2011 at 11:34

GoogleCodeExporter commented 9 years ago
First, JavaCV and JavaCPP does not use 
`java.lang.Package.getDeclaredAnnotations()` anywhere, so there is no problem 
on Android.

Second, annotations are only required when building. If you can build your 
files on another platform, and move the compiled file on your 'eclectic' 
hardware, then it could work. I would just need to add a few try/catch blocks 
there.

So, let me know if you can cross-build your software from another platform, 
thank you

Original comment by samuel.a...@gmail.com on 8 Jun 2011 at 2:35

GoogleCodeExporter commented 9 years ago
BTW, since this is an ARM machine, are you saying that .so files compiled for 
Android actually working on it?

Original comment by samuel.a...@gmail.com on 8 Jun 2011 at 4:54

GoogleCodeExporter commented 9 years ago
In regards to First - Yes, I could believe that..  My suspicion is the 
implementation of GNU Classes uses getAnnotation and calls the JVM's 
getDeclaredAnnotations - which apparently was not implemented in JamVM.  Not 
sure of all the details of the different parts... but it seems like a logical 
possibility.  Also, I saw some reference to the JamVM where it was logged as a 
bug and said it was fixed in a later version (hopefully the one I am attempting 
on installing)

I am 4000 miles away from the machine which this is being done.  Debugging in 
an IDE is not really possible.  However, as far as I can tell.. it goes into 

                oldGrabber=cvCreateCameraCapture(cameraIndex);
when the error is thrown..

I haven't replaced the JVM and GNU classpath - so I would not give it any 
attention until I get that done and run some more tests..

In regards to ARM and the .so files ... Yes, that was the intention.

Original comment by supert...@gmail.com on 8 Jun 2011 at 6:04

GoogleCodeExporter commented 9 years ago
I released a new version of JavaCPP+JavaCV that fixes the loading issue when 
the JVM does not support annotation. However, I doubt very much that native .so 
library files compiled for Android will work on another Linux-based platform. 
If you get errors like `UnsatisfiedLinkError` or `NoClassDefFoundError` even 
after putting the .so files in the system library PATH, please try to recompile 
the native libraries.

Original comment by samuel.a...@gmail.com on 10 Jun 2011 at 1:39

GoogleCodeExporter commented 9 years ago
Will do... was taking a crash course in cross compiling.  I have not tried the 
Android files yet, but soon I'll be in a position to test both Android and 
native.  We'll see.

Original comment by supert...@gmail.com on 10 Jun 2011 at 2:15