You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by pigelvy <pi...@gmail.com> on 2013/07/25 14:49:09 UTC

Leap Motion in OSGi : EXCEPTION_VIOLATION_EXCEPTION

Hi all,

I'm trying to use the new  Leap Motion
<https://www.leapmotion.com/developers>   but I end up with an
EXCEPTION_ACCESS_VIOLATION.

In my manifest I declare the Bundle-NativeCode such as 

<Bundle-NativeCode>
   x86/Leap.dll;x86/LeapJava.dll;osname=win32;processor=x86
</Bundle-NativeCode>

Of course:
 - I tried something with the same libraries outside OSGi and it works
 - the two libraries are in my bundle in the x86 folder
 - "osname=win32;processor=x86" work for other bundles

After decompiling the Leap Motion jar, I saw that LeapJava.dll is the only
library that is loaded (using System.loadLibrary("LeapJava")). Is it
possible that then do not load their other library correctly?

Any idea?



--
View this message in context: http://apache-felix.18485.x6.nabble.com/Leap-Motion-in-OSGi-EXCEPTION-VIOLATION-EXCEPTION-tp5004404.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Leap Motion in OSGi : EXCEPTION_VIOLATION_EXCEPTION

Posted by pigelvy <pi...@gmail.com>.
For the basic need of having Leap Motion work in OSGi, I managed to do it as
explained in  my StackOverflow post
<http://stackoverflow.com/questions/17858647/exception-access-violation-when-accessing-leapmotion-api-within-osgi/17924911#17924911> 
.

Basically, I create an hello-world bundle with simple Leap Motion
interaction. I only had to pre-load the Lead.dll library.

After that, I tried to apply the exact same principles to my real project
bundle, but I end up with native code exceptions such as:

   # A fatal error has been detected by the Java Runtime Environment: 
   # 
   #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000, pid=7492,
tid=5696 
   # 
   # JRE version: 6.0_30-b12 
   # Java VM: Java HotSpot(TM) Client VM (20.5-b03 mixed mode windows-x86 ) 
   # Problematic frame: 
   # C  0x00000000 


You probably don't know the Leap Motion SDK but I do receive several Leap
events before the JVM crashes with a "problematic frame".

My real bundle does not contain native code. I just don't understand why the
leap SDK fails to operate within my bundle. Even though you never worked
with LeapMotion, have you ever experienced something similar?

thx



--
View this message in context: http://apache-felix.18485.x6.nabble.com/Leap-Motion-in-OSGi-EXCEPTION-VIOLATION-EXCEPTION-tp5004404p5004426.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Leap Motion in OSGi : EXCEPTION_VIOLATION_EXCEPTION

Posted by pigelvy <pi...@gmail.com>.
I read the wiki and this is what I tried:
 - copy Leap.dll and LeapJava.dll on %FooDir% (some directory without spaces
on the path)
 - Make both libraries available to windows by customizing the %Path% in my
start.bat file (using /set Path=%FooDir%;%Path%/)
 - Remove the <Bundle-NativeCode> instruction from my manifest
 - And before creating the a com.leapmotion.leap.Controller, I called
System.load(Leap.dll and LeapJava.dll using System.loadLibrary("Leap") and
System.loadLibrary("LeapJava")

My goal was to skip OSGi for all .dll things. It does not work and I end up
with 

   # A fatal error has been detected by the Java Runtime Environment:
   #
   #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000, pid=7492,
tid=5696
   #
   # JRE version: 6.0_30-b12
   # Java VM: Java HotSpot(TM) Client VM (20.5-b03 mixed mode windows-x86 )
   # Problematic frame:
   # C  0x00000000


On Thu, Jul 25, 2013 at 3:34 PM, Neil Bartlett &lt;njbartlett@&gt; wrote:

> It's possible that there is a dependency from LeapJava.dll to Leap.dll
> within the native code. This is not something that OSGi can directly
>

Not just possible but in the case of JNI stubs rather mandatory. :)


> influence. However it does not mean all hope is lost, please read the
> following excellent wiki page on the subject (thanks again to Holger
> Hofstaette): http://wiki.osgi.org/wiki/Dependencies_In_Native_Code
>

An excellent suggestion, if I may say so myself. ;)

In this case it's very likely the "lazy resource extraction" that's at
fault (described towards the end of the wiki page). IMHO this entire
approach of allowing implementation-dependent behaviour is at odds with
platform semantics, and basically useless as currently specified. Much of
that is Java's fault to begin wth though.

-h





--
View this message in context: http://apache-felix.18485.x6.nabble.com/Leap-Motion-in-OSGi-EXCEPTION-VIOLATION-EXCEPTION-tp5004404p5004414.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Leap Motion in OSGi : EXCEPTION_VIOLATION_EXCEPTION

Posted by Holger Hoffstätte <ho...@googlemail.com>.
On Thu, Jul 25, 2013 at 3:34 PM, Neil Bartlett <nj...@gmail.com> wrote:

> It's possible that there is a dependency from LeapJava.dll to Leap.dll
> within the native code. This is not something that OSGi can directly
>

Not just possible but in the case of JNI stubs rather mandatory. :)


> influence. However it does not mean all hope is lost, please read the
> following excellent wiki page on the subject (thanks again to Holger
> Hofstaette): http://wiki.osgi.org/wiki/Dependencies_In_Native_Code
>

An excellent suggestion, if I may say so myself. ;)

In this case it's very likely the "lazy resource extraction" that's at
fault (described towards the end of the wiki page). IMHO this entire
approach of allowing implementation-dependent behaviour is at odds with
platform semantics, and basically useless as currently specified. Much of
that is Java's fault to begin wth though.

-h

Re: Leap Motion in OSGi : EXCEPTION_VIOLATION_EXCEPTION

Posted by Neil Bartlett <nj...@gmail.com>.
It's possible that there is a dependency from LeapJava.dll to Leap.dll
within the native code. This is not something that OSGi can directly
influence. However it does not mean all hope is lost, please read the
following excellent wiki page on the subject (thanks again to Holger
Hofstaette): http://wiki.osgi.org/wiki/Dependencies_In_Native_Code

Neil

On Thu, Jul 25, 2013 at 1:49 PM, pigelvy <pi...@gmail.com> wrote:
> Hi all,
>
> I'm trying to use the new  Leap Motion
> <https://www.leapmotion.com/developers>   but I end up with an
> EXCEPTION_ACCESS_VIOLATION.
>
> In my manifest I declare the Bundle-NativeCode such as
>
> <Bundle-NativeCode>
>    x86/Leap.dll;x86/LeapJava.dll;osname=win32;processor=x86
> </Bundle-NativeCode>
>
> Of course:
>  - I tried something with the same libraries outside OSGi and it works
>  - the two libraries are in my bundle in the x86 folder
>  - "osname=win32;processor=x86" work for other bundles
>
> After decompiling the Leap Motion jar, I saw that LeapJava.dll is the only
> library that is loaded (using System.loadLibrary("LeapJava")). Is it
> possible that then do not load their other library correctly?
>
> Any idea?
>
>
>
> --
> View this message in context: http://apache-felix.18485.x6.nabble.com/Leap-Motion-in-OSGi-EXCEPTION-VIOLATION-EXCEPTION-tp5004404.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org