You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by chihi asma <ch...@yahoo.fr> on 2009/04/27 16:28:40 UTC
JNA problem
Hi,
I am a beginner in JNA and I want to test it with OSGi, so I implemented a simple bundle using JNA, but when I start it, I get this error:
Couldn't start bundle: JNA (#37) (due to: java.lang.NoClassDefFoundError: com/sun/jna/Library)
java.lang.NoClassDefFoundError: com/sun/jna/Library
the jna.jar is on my path.
Can anyone help me?
Thanks in advance.
Asma
Re: JNA problem
Posted by Stuart McCulloch <mc...@gmail.com>.
2009/4/27 Richard S. Hall <he...@ungoverned.org>
> You have two options:
>
> 1. Put the jna.jar in a bundle and export all of its packages.
> 2. Add the jna.jar packages to
> org.osgi.framework.system.packages.extra in the
> conf/config.properties file so the system bundle exports them from
> the class path (assuming you have the jna.jar on the class path).
>
and also make sure you have "com.sun.jna" in the Import-Package of the
bundle that wants to use it :)
you might want to have a look at the Felix tutorials:
http://felix.apache.org/site/apache-felix-osgi-tutorial.html
as well as some other online OSGi tutorials / examples:
http://neilbartlett.name/blog/osgi-articles/
http://www.aqute.biz/Snippets/HomePage
HTH
> -> richard
>
> On 4/27/09 10:28 AM, chihi asma wrote:
>
>> Hi,
>>
>> I am a beginner in JNA and I want to test it with OSGi, so I implemented a
>> simple bundle using JNA, but when I start it, I get this error:
>> Couldn't start bundle: JNA (#37) (due to: java.lang.NoClassDefFoundError:
>> com/sun/jna/Library)
>> java.lang.NoClassDefFoundError: com/sun/jna/Library
>>
>> the jna.jar is on my path.
>>
>> Can anyone help me?
>>
>> Thanks in advance.
>>
>> Asma
>>
>>
>>
>>
>>
>>
>>
>
--
Cheers, Stuart
Re: JNA problem
Posted by "Richard S. Hall" <he...@ungoverned.org>.
You have two options:
1. Put the jna.jar in a bundle and export all of its packages.
2. Add the jna.jar packages to
org.osgi.framework.system.packages.extra in the
conf/config.properties file so the system bundle exports them from
the class path (assuming you have the jna.jar on the class path).
-> richard
On 4/27/09 10:28 AM, chihi asma wrote:
> Hi,
>
> I am a beginner in JNA and I want to test it with OSGi, so I implemented a simple bundle using JNA, but when I start it, I get this error:
> Couldn't start bundle: JNA (#37) (due to: java.lang.NoClassDefFoundError: com/sun/jna/Library)
> java.lang.NoClassDefFoundError: com/sun/jna/Library
>
> the jna.jar is on my path.
>
> Can anyone help me?
>
> Thanks in advance.
>
> Asma
>
>
>
>
>
>