You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Tony Anecito <ad...@yahoo.com> on 2010/09/27 04:22:11 UTC

Bundle-NativeCode question...

Hi All,

I have my native libs for each OS in separate jars and in some cases I have 
quite a few jars. I have some simple questions

1. Can I keep my native jars as separate bundles?
2. Can I use *.dll in the manifest instead of naming every library?
3. What is the osname for Windows 7?

Bundle-NativeCode: *.dll; osname=winxp; osname=winvista; processor=x86

Thanks,
-Tony


      

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


Re: Bundle-NativeCode question...

Posted by "Richard S. Hall" <he...@ungoverned.org>.
  On 9/27/10 1:52, Marcel Offermans wrote:
> On 27 Sep 2010, at 5:09 , Richard S. Hall wrote:
>> On 9/26/10 22:22, Tony Anecito wrote:
>>> I have my native libs for each OS in separate jars and in some cases I have
>>> quite a few jars. I have some simple questions
>>>
>>> 1. Can I keep my native jars as separate bundles?
>> No, they must be packaged in the bundle JAR containing the dependent native classes.
> I always thought that you can package them in different fragments if you want. Admittedly, fragments are not "separate bundles" in the sense that at deployment they form one logical bundle, but they can be physically distributed as different jar files.

True. Technically, you can package them in fragments and have the 
framework merge them back into the bundle containing the dependent 
native classes. I don't regularly think about using fragments. :-)

-> richard

> Greetings, Marcel
>
>
> ---------------------------------------------------------------------
> 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


Re: Bundle-NativeCode question...

Posted by Marcel Offermans <ma...@luminis.nl>.
On 27 Sep 2010, at 5:09 , Richard S. Hall wrote:
> On 9/26/10 22:22, Tony Anecito wrote:
>> I have my native libs for each OS in separate jars and in some cases I have
>> quite a few jars. I have some simple questions
>> 
>> 1. Can I keep my native jars as separate bundles?
> 
> No, they must be packaged in the bundle JAR containing the dependent native classes.

I always thought that you can package them in different fragments if you want. Admittedly, fragments are not "separate bundles" in the sense that at deployment they form one logical bundle, but they can be physically distributed as different jar files.

Greetings, Marcel


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


Re: Bundle-NativeCode question...

Posted by Tony Anecito <ad...@yahoo.com>.
Thanks if I find a reference for use of Web Start you will be the first to know.

I just heard that Web Start has problems with SOCKS Proxy. Hopefully OSGi does 
not have issues with that type of proxy.

Regards,
-Tony



----- Original Message ----
From: Richard S. Hall <he...@ungoverned.org>
To: users@felix.apache.org
Sent: Mon, September 27, 2010 9:46:52 AM
Subject: Re: Bundle-NativeCode question...

  On 9/27/10 11:07, Tony Anecito wrote:
> First off thanks Richard for your prompt replies.
>
> What I did using web start was have seperate bundles for each OS/arch for the
> swing client so there is no duplication. I kept the java classes out of the
> native lib jars for web start. So do I have to duplicate the bundles with the
> classes since those are not OS dependant? I never thought about that because 
>web
> start allows you to have jars that are used for all OS's so no duplication
> occurs.

In OSGi, native libraries must logically be packaged with the classes 
that depend on them. As Marcel reminded me, you can use fragments to 
avoid physically packaging them in the same JAR file, but the end result 
is the same as if they were physically package together, i.e., you must 
end up with the correct native libraries attached to the host needing them.

For example, assume you have two bundles needing native libraries, host1 
and host2. Further assume you have native libraries for Linux and 
Windows. You would need 6 different bundles that would be as follows to 
the different platforms:

    * Windows:
          o host1.jar + frag1win.jar
          o host2.jar + frag2win.jar
    * Linux
          o host1.jar + frag1linux.jar
          o host2.jar + frag2linux.jar

This avoid duplication at the expense of having more artifacts to manage.

> Is there an example of using web start with osgi out there? Seems like a small
> launcher class of some sort would be used.

There are people who have done it, but I don't know of an example on the 
web...if you find one, let me know and I can add a reference to our FAQ.

-> richard

> Regards,
> -Tony
>
>
>
> ----- Original Message ----
> From: Richard S. Hall<he...@ungoverned.org>
> To: users@felix.apache.org
> Sent: Mon, September 27, 2010 7:45:04 AM
> Subject: Re: Bundle-NativeCode question...
>
>
>
> On 9/26/10 23:41, Tony Anecito wrote:
>> Okay the reason I asked about the *.dll because I have over 200 dlls. I can
>> write a program that reads the libs and creates the names with the ; for the
>> manifest file I guess.
> Yeah, I'd recommend that.
>
>> When I said separate bundles I meant one for native dlls for windows, one for
>> linux and one for the mac.
>> So I can not do that? I am hoping like Web Start Felix will download the
> bundle
>> with the native libs for the OS and arch the client is using not all the
>> bundles
>> for each OS. That is why I would have a native bundle for each OS.
> Yes, you can create separate bundles for each native platform (i.e.,
> classes + libs for Windows, classes + libs for Linux, etc.). You end up
> with a bunch of duplicate content and more artifacts to manage, but the
> individual artifacts will be a little smaller.
>
>> One last question. Does Felix/OSGi download the jvm if one is not present? So
>> for a first time user of an app using OSGi/Felix will the jvm be loaded using
>> some attribute of a bundle?
> No, you must use something Web Start to bootstrap the process.
>
> ->  richard
>
>> Thanks,
>> -Tony
>>
>>
>>  
>>
>>
>> ----- Original Message ----
>> From: Richard S. Hall<he...@ungoverned.org>
>> To: users@felix.apache.org
>> Sent: Sun, September 26, 2010 9:09:06 PM
>> Subject: Re: Bundle-NativeCode question...
>>
>>      On 9/26/10 22:22, Tony Anecito wrote:
>>> Hi All,
>>>
>>> I have my native libs for each OS in separate jars and in some cases I have
>>> quite a few jars. I have some simple questions
>>>
>>> 1. Can I keep my native jars as separate bundles?
>> No, they must be packaged in the bundle JAR containing the dependent
>> native classes.
>>
>>> 2. Can I use *.dll in the manifest instead of naming every library?
>> No.
>>
>>> 3. What is the osname for Windows 7?
>>>
>>> Bundle-NativeCode: *.dll; osname=winxp; osname=winvista; processor=x86
>> The spec mentions that new names are defined here:
>>
>>        http://www.osgi.org/Specifications/Reference
>>
>> ->  richard
>>
>>> Thanks,
>>> -Tony
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>
>
> ---------------------------------------------------------------------
> 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


      

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


Re: Bundle-NativeCode question...

Posted by "Richard S. Hall" <he...@ungoverned.org>.
  On 9/27/10 11:07, Tony Anecito wrote:
> First off thanks Richard for your prompt replies.
>
> What I did using web start was have seperate bundles for each OS/arch for the
> swing client so there is no duplication. I kept the java classes out of the
> native lib jars for web start. So do I have to duplicate the bundles with the
> classes since those are not OS dependant? I never thought about that because web
> start allows you to have jars that are used for all OS's so no duplication
> occurs.

In OSGi, native libraries must logically be packaged with the classes 
that depend on them. As Marcel reminded me, you can use fragments to 
avoid physically packaging them in the same JAR file, but the end result 
is the same as if they were physically package together, i.e., you must 
end up with the correct native libraries attached to the host needing them.

For example, assume you have two bundles needing native libraries, host1 
and host2. Further assume you have native libraries for Linux and 
Windows. You would need 6 different bundles that would be as follows to 
the different platforms:

    * Windows:
          o host1.jar + frag1win.jar
          o host2.jar + frag2win.jar
    * Linux
          o host1.jar + frag1linux.jar
          o host2.jar + frag2linux.jar

This avoid duplication at the expense of having more artifacts to manage.

> Is there an example of using web start with osgi out there? Seems like a small
> launcher class of some sort would be used.

There are people who have done it, but I don't know of an example on the 
web...if you find one, let me know and I can add a reference to our FAQ.

-> richard

> Regards,
> -Tony
>
>
>
> ----- Original Message ----
> From: Richard S. Hall<he...@ungoverned.org>
> To: users@felix.apache.org
> Sent: Mon, September 27, 2010 7:45:04 AM
> Subject: Re: Bundle-NativeCode question...
>
>
>
> On 9/26/10 23:41, Tony Anecito wrote:
>> Okay the reason I asked about the *.dll because I have over 200 dlls. I can
>> write a program that reads the libs and creates the names with the ; for the
>> manifest file I guess.
> Yeah, I'd recommend that.
>
>> When I said separate bundles I meant one for native dlls for windows, one for
>> linux and one for the mac.
>> So I can not do that? I am hoping like Web Start Felix will download the
> bundle
>> with the native libs for the OS and arch the client is using not all the
>> bundles
>> for each OS. That is why I would have a native bundle for each OS.
> Yes, you can create separate bundles for each native platform (i.e.,
> classes + libs for Windows, classes + libs for Linux, etc.). You end up
> with a bunch of duplicate content and more artifacts to manage, but the
> individual artifacts will be a little smaller.
>
>> One last question. Does Felix/OSGi download the jvm if one is not present? So
>> for a first time user of an app using OSGi/Felix will the jvm be loaded using
>> some attribute of a bundle?
> No, you must use something Web Start to bootstrap the process.
>
> ->  richard
>
>> Thanks,
>> -Tony
>>
>>
>>   
>>
>>
>> ----- Original Message ----
>> From: Richard S. Hall<he...@ungoverned.org>
>> To: users@felix.apache.org
>> Sent: Sun, September 26, 2010 9:09:06 PM
>> Subject: Re: Bundle-NativeCode question...
>>
>>      On 9/26/10 22:22, Tony Anecito wrote:
>>> Hi All,
>>>
>>> I have my native libs for each OS in separate jars and in some cases I have
>>> quite a few jars. I have some simple questions
>>>
>>> 1. Can I keep my native jars as separate bundles?
>> No, they must be packaged in the bundle JAR containing the dependent
>> native classes.
>>
>>> 2. Can I use *.dll in the manifest instead of naming every library?
>> No.
>>
>>> 3. What is the osname for Windows 7?
>>>
>>> Bundle-NativeCode: *.dll; osname=winxp; osname=winvista; processor=x86
>> The spec mentions that new names are defined here:
>>
>>        http://www.osgi.org/Specifications/Reference
>>
>> ->   richard
>>
>>> Thanks,
>>> -Tony
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>
>
> ---------------------------------------------------------------------
> 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


Re: Bundle-NativeCode question...

Posted by Tony Anecito <ad...@yahoo.com>.
First off thanks Richard for your prompt replies.

What I did using web start was have seperate bundles for each OS/arch for the 
swing client so there is no duplication. I kept the java classes out of the 
native lib jars for web start. So do I have to duplicate the bundles with the 
classes since those are not OS dependant? I never thought about that because web 
start allows you to have jars that are used for all OS's so no duplication 
occurs.

Is there an example of using web start with osgi out there? Seems like a small 
launcher class of some sort would be used.

Regards,
-Tony



----- Original Message ----
From: Richard S. Hall <he...@ungoverned.org>
To: users@felix.apache.org
Sent: Mon, September 27, 2010 7:45:04 AM
Subject: Re: Bundle-NativeCode question...



On 9/26/10 23:41, Tony Anecito wrote:
> Okay the reason I asked about the *.dll because I have over 200 dlls. I can
> write a program that reads the libs and creates the names with the ; for the
> manifest file I guess.

Yeah, I'd recommend that.

> When I said separate bundles I meant one for native dlls for windows, one for
> linux and one for the mac.
> So I can not do that? I am hoping like Web Start Felix will download the 
bundle
> with the native libs for the OS and arch the client is using not all the 
>bundles
> for each OS. That is why I would have a native bundle for each OS.

Yes, you can create separate bundles for each native platform (i.e., 
classes + libs for Windows, classes + libs for Linux, etc.). You end up 
with a bunch of duplicate content and more artifacts to manage, but the 
individual artifacts will be a little smaller.

> One last question. Does Felix/OSGi download the jvm if one is not present? So
> for a first time user of an app using OSGi/Felix will the jvm be loaded using
> some attribute of a bundle?

No, you must use something Web Start to bootstrap the process.

-> richard

>
> Thanks,
> -Tony
>
>
>  
>
>
> ----- Original Message ----
> From: Richard S. Hall<he...@ungoverned.org>
> To: users@felix.apache.org
> Sent: Sun, September 26, 2010 9:09:06 PM
> Subject: Re: Bundle-NativeCode question...
>
>    On 9/26/10 22:22, Tony Anecito wrote:
>> Hi All,
>>
>> I have my native libs for each OS in separate jars and in some cases I have
>> quite a few jars. I have some simple questions
>>
>> 1. Can I keep my native jars as separate bundles?
> No, they must be packaged in the bundle JAR containing the dependent
> native classes.
>
>> 2. Can I use *.dll in the manifest instead of naming every library?
> No.
>
>> 3. What is the osname for Windows 7?
>>
>> Bundle-NativeCode: *.dll; osname=winxp; osname=winvista; processor=x86
> The spec mentions that new names are defined here:
>
>      http://www.osgi.org/Specifications/Reference
>
> ->  richard
>
>> Thanks,
>> -Tony
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>
>
> ---------------------------------------------------------------------
> 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


      

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


Re: Bundle-NativeCode question...

Posted by "Richard S. Hall" <he...@ungoverned.org>.

On 9/26/10 23:41, Tony Anecito wrote:
> Okay the reason I asked about the *.dll because I have over 200 dlls. I can
> write a program that reads the libs and creates the names with the ; for the
> manifest file I guess.

Yeah, I'd recommend that.

> When I said separate bundles I meant one for native dlls for windows, one for
> linux and one for the mac.
> So I can not do that? I am hoping like Web Start Felix will download the bundle
> with the native libs for the OS and arch the client is using not all the bundles
> for each OS. That is why I would have a native bundle for each OS.

Yes, you can create separate bundles for each native platform (i.e., 
classes + libs for Windows, classes + libs for Linux, etc.). You end up 
with a bunch of duplicate content and more artifacts to manage, but the 
individual artifacts will be a little smaller.

> One last question. Does Felix/OSGi download the jvm if one is not present? So
> for a first time user of an app using OSGi/Felix will the jvm be loaded using
> some attribute of a bundle?

No, you must use something Web Start to bootstrap the process.

-> richard

>
> Thanks,
> -Tony
>
>
>   
>
>
> ----- Original Message ----
> From: Richard S. Hall<he...@ungoverned.org>
> To: users@felix.apache.org
> Sent: Sun, September 26, 2010 9:09:06 PM
> Subject: Re: Bundle-NativeCode question...
>
>    On 9/26/10 22:22, Tony Anecito wrote:
>> Hi All,
>>
>> I have my native libs for each OS in separate jars and in some cases I have
>> quite a few jars. I have some simple questions
>>
>> 1. Can I keep my native jars as separate bundles?
> No, they must be packaged in the bundle JAR containing the dependent
> native classes.
>
>> 2. Can I use *.dll in the manifest instead of naming every library?
> No.
>
>> 3. What is the osname for Windows 7?
>>
>> Bundle-NativeCode: *.dll; osname=winxp; osname=winvista; processor=x86
> The spec mentions that new names are defined here:
>
>      http://www.osgi.org/Specifications/Reference
>
> ->  richard
>
>> Thanks,
>> -Tony
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>
>
> ---------------------------------------------------------------------
> 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


Re: Bundle-NativeCode question...

Posted by Tony Anecito <ad...@yahoo.com>.
Okay the reason I asked about the *.dll because I have over 200 dlls. I can 
write a program that reads the libs and creates the names with the ; for the 
manifest file I guess.

When I said separate bundles I meant one for native dlls for windows, one for 
linux and one for the mac.
So I can not do that? I am hoping like Web Start Felix will download the bundle 
with the native libs for the OS and arch the client is using not all the bundles 
for each OS. That is why I would have a native bundle for each OS.

One last question. Does Felix/OSGi download the jvm if one is not present? So 
for a first time user of an app using OSGi/Felix will the jvm be loaded using 
some attribute of a bundle?


Thanks,
-Tony


 


----- Original Message ----
From: Richard S. Hall <he...@ungoverned.org>
To: users@felix.apache.org
Sent: Sun, September 26, 2010 9:09:06 PM
Subject: Re: Bundle-NativeCode question...

  On 9/26/10 22:22, Tony Anecito wrote:
> Hi All,
>
> I have my native libs for each OS in separate jars and in some cases I have
> quite a few jars. I have some simple questions
>
> 1. Can I keep my native jars as separate bundles?

No, they must be packaged in the bundle JAR containing the dependent 
native classes.

> 2. Can I use *.dll in the manifest instead of naming every library?

No.

> 3. What is the osname for Windows 7?
>
> Bundle-NativeCode: *.dll; osname=winxp; osname=winvista; processor=x86

The spec mentions that new names are defined here:

    http://www.osgi.org/Specifications/Reference

-> richard

> Thanks,
> -Tony
>
>
>
>
> ---------------------------------------------------------------------
> 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


      

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


Re: Bundle-NativeCode question...

Posted by "Richard S. Hall" <he...@ungoverned.org>.
  On 9/26/10 22:22, Tony Anecito wrote:
> Hi All,
>
> I have my native libs for each OS in separate jars and in some cases I have
> quite a few jars. I have some simple questions
>
> 1. Can I keep my native jars as separate bundles?

No, they must be packaged in the bundle JAR containing the dependent 
native classes.

> 2. Can I use *.dll in the manifest instead of naming every library?

No.

> 3. What is the osname for Windows 7?
>
> Bundle-NativeCode: *.dll; osname=winxp; osname=winvista; processor=x86

The spec mentions that new names are defined here:

     http://www.osgi.org/Specifications/Reference

-> richard

> Thanks,
> -Tony
>
>
>
>
> ---------------------------------------------------------------------
> 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


RE: Bundle-NativeCode question...

Posted by Joel Schuster <jo...@Navsys.com>.
Can't remember the reference but osname=win7 will work. So will win32 actually if they happen to use the same dlls.

- Joel
________________________________________
From: Tony Anecito [adanecito@yahoo.com]
Sent: Sunday, September 26, 2010 8:22 PM
To: Apache-felix-Dev
Subject: Bundle-NativeCode question...

Hi All,

I have my native libs for each OS in separate jars and in some cases I have
quite a few jars. I have some simple questions

1. Can I keep my native jars as separate bundles?
2. Can I use *.dll in the manifest instead of naming every library?
3. What is the osname for Windows 7?

Bundle-NativeCode: *.dll; osname=winxp; osname=winvista; processor=x86

Thanks,
-Tony




---------------------------------------------------------------------
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