You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Benoît Thiébault <th...@artenum.com> on 2014/03/29 08:47:40 UTC

OBR, bundle fragments and native code

Hi everyone,

I’m willing to simplify my application deployment and plan to use an OBR. On this OBR, I have deployed several bundles, including some containing native code.

I have a cross-platform bundle, say org.example.nativelib and one fragment for each platform:
- org.example.nativelib.linux64b
- org.example.nativelib.linux32b
- org.example.nativelib.win7-64b
- org.example.nativelib.osx64b
- etc.

How can I be sure that when deploying org.example.nativelib from the OBR, the native fragment of the correct platform will be deployed?

Thanks for your help

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


Re: OBR, bundle fragments and native code

Posted by Benoît Thiébault <th...@artenum.com>.
Well, that’s unfortunate!

I have declared the platform like this (for the example of MacOS):

<Bundle-NativeCode>
vtk/libCosmo.jnilib;
[…]
vtk/libvtkzlib.jnilib;
osname=MacOSX;
processor=x86_64, *
</Bundle-NativeCode>

But when I deploy the bundle, it loads the Linux 32 bits one (I guess the first one in the list)…

Welcome to Apache Felix Gogo

g! obr:repos add file:/Users/ben/.m2/repository/repository.xml
g! obr:deploy org-example-myapp
g! Target resource(s):
-------------------
   My App (2.5.7.SNAPSHOT)

Required resource(s):
---------------------

   VTK service API (2.0.3.SNAPSHOT)

Optional resource(s):
---------------------
   Linux 32 bits VTK bundle (2.0.3.SNAPSHOT)

Deploying...
done.
g! 

Le 31 mars 2014 à 17:56, Neil Bartlett <nj...@gmail.com> a écrit :

> Okay so here's the thing... if you run this on any pre-R6 framework, then
> nothing provides this capability. And since R6 is not released, that means
> all of them.
> 
> But you shouldn't have to explicitly require the osgi.ee capability. Even
> on R5 and earlier, the Bundle-NativeCode header creates an implicit
> requirement for the correct platform -- assuming you did not use a wildcard
> entry and got the format of this header correct (it is tricky).
> 
> Regards,
> Neil
> 
> 
> On Mon, Mar 31, 2014 at 10:38 AM, Benoît Thiébault <th...@artenum.com>wrote:
> 
>> Hi again,
>> 
>> What bundle provides the osgi.native capability? When running Felix, I
>> have the following error:
>> 
>> g! org.osgi.framework.BundleException: Unresolved constraint in bundle
>> org-myapp [42]: Unable to resolve 42.0: missing requirement [42.0]
>> org.myapp.native; (library=vtk) [caused by: Unable to resolve 43.0: missing
>> requirement [43.0] osgi.native;
>> (&(osgi.native.osname=MacOS)(os.native.processor=x86_64))]
>> 
>> I’m using Felix 4.2.1 and I’m pretty sure I’m on a 64 bits Mac (Mavericks
>> 10.9.2)
>> 
>> Kind regards
>> Ben
>> 
>> Le 29 mars 2014 à 11:21, Neil Bartlett <nj...@gmail.com> a écrit :
>> 
>>> You cannot do this with OBR. If you can use the R5 repository format,
>> along
>>> with the repoindex tool, then you can use Provide- and Require-Capability
>>> headers to ensure the set of libraries you need is resolved. For example
>>> the fragment "org.example.nativelib.osx64" would provide something custom
>>> like this:
>>> 
>>>   Provide-Capability: myapp.native; library=com.example.nativelib
>>> 
>>> and it would require the osgi.native capability to ensure it can only
>>> resolve on a single platform:
>>> 
>>>   Require-Capability: osgi.native;
>>> filter:="(&(osgi.native.osname=MacOS)(os.native.processor=x86_64))"
>>> 
>>> Now your core bundle just requires the myapp.native capability and the
>>> resolver will pick the right fragment for your runtime platform.
>>> 
>>> 
>>> On Sat, Mar 29, 2014 at 7:47 AM, Benoît Thiébault <thiebault@artenum.com
>>> wrote:
>>> 
>>>> Hi everyone,
>>>> 
>>>> I’m willing to simplify my application deployment and plan to use an
>> OBR.
>>>> On this OBR, I have deployed several bundles, including some containing
>>>> native code.
>>>> 
>>>> I have a cross-platform bundle, say org.example.nativelib and one
>> fragment
>>>> for each platform:
>>>> - org.example.nativelib.linux64b
>>>> - org.example.nativelib.linux32b
>>>> - org.example.nativelib.win7-64b
>>>> - org.example.nativelib.osx64b
>>>> - etc.
>>>> 
>>>> How can I be sure that when deploying org.example.nativelib from the
>> OBR,
>>>> the native fragment of the correct platform will be deployed?
>>>> 
>>>> Thanks for your help
>>>> 
>>>> Benoît
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>> 
>>>> 
>> 
>> --
>> Dr Benoît Thiébault
>> Project Manager
>> 
>>  Artenum Toulouse - Science & Groupware
>>  http://www.artenum.com
>> 
>>      Bâtiment Calfocenter
>>      10, rue Marguerite-Long
>>      31320 Castanet-Tolosan
>>      France
>>      Phone: +33 (0)5 82 95 19 00
>> 
>> 
>> 

-- 
Dr Benoît Thiébault
Project Manager

  Artenum Toulouse - Science & Groupware
  http://www.artenum.com

      Bâtiment Calfocenter
      10, rue Marguerite-Long
      31320 Castanet-Tolosan
      France
      Phone: +33 (0)5 82 95 19 00



Re: OBR, bundle fragments and native code

Posted by Neil Bartlett <nj...@gmail.com>.
Sorry I meant osgi.native in the previous message... osgi.ee is another
capability entirely :-)

Both of these will be provided by the framework, i.e. by the system bundle.


On Mon, Mar 31, 2014 at 4:56 PM, Neil Bartlett <nj...@gmail.com> wrote:

> Okay so here's the thing... if you run this on any pre-R6 framework, then
> nothing provides this capability. And since R6 is not released, that means
> all of them.
>
> But you shouldn't have to explicitly require the osgi.ee capability. Even
> on R5 and earlier, the Bundle-NativeCode header creates an implicit
> requirement for the correct platform -- assuming you did not use a wildcard
> entry and got the format of this header correct (it is tricky).
>
> Regards,
> Neil
>
>
> On Mon, Mar 31, 2014 at 10:38 AM, Benoît Thiébault <th...@artenum.com>wrote:
>
>> Hi again,
>>
>> What bundle provides the osgi.native capability? When running Felix, I
>> have the following error:
>>
>> g! org.osgi.framework.BundleException: Unresolved constraint in bundle
>> org-myapp [42]: Unable to resolve 42.0: missing requirement [42.0]
>> org.myapp.native; (library=vtk) [caused by: Unable to resolve 43.0: missing
>> requirement [43.0] osgi.native;
>> (&(osgi.native.osname=MacOS)(os.native.processor=x86_64))]
>>
>> I’m using Felix 4.2.1 and I’m pretty sure I’m on a 64 bits Mac (Mavericks
>> 10.9.2)
>>
>> Kind regards
>> Ben
>>
>> Le 29 mars 2014 à 11:21, Neil Bartlett <nj...@gmail.com> a écrit :
>>
>> > You cannot do this with OBR. If you can use the R5 repository format,
>> along
>> > with the repoindex tool, then you can use Provide- and
>> Require-Capability
>> > headers to ensure the set of libraries you need is resolved. For example
>> > the fragment "org.example.nativelib.osx64" would provide something
>> custom
>> > like this:
>> >
>> >    Provide-Capability: myapp.native; library=com.example.nativelib
>> >
>> > and it would require the osgi.native capability to ensure it can only
>> > resolve on a single platform:
>> >
>> >    Require-Capability: osgi.native;
>> > filter:="(&(osgi.native.osname=MacOS)(os.native.processor=x86_64))"
>> >
>> > Now your core bundle just requires the myapp.native capability and the
>> > resolver will pick the right fragment for your runtime platform.
>> >
>> >
>> > On Sat, Mar 29, 2014 at 7:47 AM, Benoît Thiébault <
>> thiebault@artenum.com>wrote:
>> >
>> >> Hi everyone,
>> >>
>> >> I’m willing to simplify my application deployment and plan to use an
>> OBR.
>> >> On this OBR, I have deployed several bundles, including some containing
>> >> native code.
>> >>
>> >> I have a cross-platform bundle, say org.example.nativelib and one
>> fragment
>> >> for each platform:
>> >> - org.example.nativelib.linux64b
>> >> - org.example.nativelib.linux32b
>> >> - org.example.nativelib.win7-64b
>> >> - org.example.nativelib.osx64b
>> >> - etc.
>> >>
>> >> How can I be sure that when deploying org.example.nativelib from the
>> OBR,
>> >> the native fragment of the correct platform will be deployed?
>> >>
>> >> Thanks for your help
>> >>
>> >> Benoît
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> >> For additional commands, e-mail: users-help@felix.apache.org
>> >>
>> >>
>>
>> --
>> Dr Benoît Thiébault
>> Project Manager
>>
>>   Artenum Toulouse - Science & Groupware
>>   http://www.artenum.com
>>
>>       Bâtiment Calfocenter
>>       10, rue Marguerite-Long
>>       31320 Castanet-Tolosan
>>       France
>>       Phone: +33 (0)5 82 95 19 00
>>
>>
>>
>

Re: OBR, bundle fragments and native code

Posted by Neil Bartlett <nj...@gmail.com>.
Okay so here's the thing... if you run this on any pre-R6 framework, then
nothing provides this capability. And since R6 is not released, that means
all of them.

But you shouldn't have to explicitly require the osgi.ee capability. Even
on R5 and earlier, the Bundle-NativeCode header creates an implicit
requirement for the correct platform -- assuming you did not use a wildcard
entry and got the format of this header correct (it is tricky).

Regards,
Neil


On Mon, Mar 31, 2014 at 10:38 AM, Benoît Thiébault <th...@artenum.com>wrote:

> Hi again,
>
> What bundle provides the osgi.native capability? When running Felix, I
> have the following error:
>
> g! org.osgi.framework.BundleException: Unresolved constraint in bundle
> org-myapp [42]: Unable to resolve 42.0: missing requirement [42.0]
> org.myapp.native; (library=vtk) [caused by: Unable to resolve 43.0: missing
> requirement [43.0] osgi.native;
> (&(osgi.native.osname=MacOS)(os.native.processor=x86_64))]
>
> I’m using Felix 4.2.1 and I’m pretty sure I’m on a 64 bits Mac (Mavericks
> 10.9.2)
>
> Kind regards
> Ben
>
> Le 29 mars 2014 à 11:21, Neil Bartlett <nj...@gmail.com> a écrit :
>
> > You cannot do this with OBR. If you can use the R5 repository format,
> along
> > with the repoindex tool, then you can use Provide- and Require-Capability
> > headers to ensure the set of libraries you need is resolved. For example
> > the fragment "org.example.nativelib.osx64" would provide something custom
> > like this:
> >
> >    Provide-Capability: myapp.native; library=com.example.nativelib
> >
> > and it would require the osgi.native capability to ensure it can only
> > resolve on a single platform:
> >
> >    Require-Capability: osgi.native;
> > filter:="(&(osgi.native.osname=MacOS)(os.native.processor=x86_64))"
> >
> > Now your core bundle just requires the myapp.native capability and the
> > resolver will pick the right fragment for your runtime platform.
> >
> >
> > On Sat, Mar 29, 2014 at 7:47 AM, Benoît Thiébault <thiebault@artenum.com
> >wrote:
> >
> >> Hi everyone,
> >>
> >> I’m willing to simplify my application deployment and plan to use an
> OBR.
> >> On this OBR, I have deployed several bundles, including some containing
> >> native code.
> >>
> >> I have a cross-platform bundle, say org.example.nativelib and one
> fragment
> >> for each platform:
> >> - org.example.nativelib.linux64b
> >> - org.example.nativelib.linux32b
> >> - org.example.nativelib.win7-64b
> >> - org.example.nativelib.osx64b
> >> - etc.
> >>
> >> How can I be sure that when deploying org.example.nativelib from the
> OBR,
> >> the native fragment of the correct platform will be deployed?
> >>
> >> Thanks for your help
> >>
> >> Benoît
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> >> For additional commands, e-mail: users-help@felix.apache.org
> >>
> >>
>
> --
> Dr Benoît Thiébault
> Project Manager
>
>   Artenum Toulouse - Science & Groupware
>   http://www.artenum.com
>
>       Bâtiment Calfocenter
>       10, rue Marguerite-Long
>       31320 Castanet-Tolosan
>       France
>       Phone: +33 (0)5 82 95 19 00
>
>
>

Re: OBR, bundle fragments and native code

Posted by Benoît Thiébault <th...@artenum.com>.
I ran the "inspect capability osgi.native" that confirmed no bundle provides it.

Is this a standard OSGi capability or do I have to implement a specific bundle to provide it?

Kind regards,
Ben

Le 31 mars 2014 à 11:38, Benoît Thiébault <th...@artenum.com> a écrit :

> Hi again,
> 
> What bundle provides the osgi.native capability? When running Felix, I have the following error:
> 
> g! org.osgi.framework.BundleException: Unresolved constraint in bundle org-myapp [42]: Unable to resolve 42.0: missing requirement [42.0] org.myapp.native; (library=vtk) [caused by: Unable to resolve 43.0: missing requirement [43.0] osgi.native; (&(osgi.native.osname=MacOS)(os.native.processor=x86_64))]
> 
> I’m using Felix 4.2.1 and I’m pretty sure I’m on a 64 bits Mac (Mavericks 10.9.2)
> 
> Kind regards
> Ben
> 
> Le 29 mars 2014 à 11:21, Neil Bartlett <nj...@gmail.com> a écrit :
> 
>> You cannot do this with OBR. If you can use the R5 repository format, along
>> with the repoindex tool, then you can use Provide- and Require-Capability
>> headers to ensure the set of libraries you need is resolved. For example
>> the fragment "org.example.nativelib.osx64" would provide something custom
>> like this:
>> 
>>   Provide-Capability: myapp.native; library=com.example.nativelib
>> 
>> and it would require the osgi.native capability to ensure it can only
>> resolve on a single platform:
>> 
>>   Require-Capability: osgi.native;
>> filter:="(&(osgi.native.osname=MacOS)(os.native.processor=x86_64))"
>> 
>> Now your core bundle just requires the myapp.native capability and the
>> resolver will pick the right fragment for your runtime platform.
>> 
>> 
>> On Sat, Mar 29, 2014 at 7:47 AM, Benoît Thiébault <th...@artenum.com>wrote:
>> 
>>> Hi everyone,
>>> 
>>> I’m willing to simplify my application deployment and plan to use an OBR.
>>> On this OBR, I have deployed several bundles, including some containing
>>> native code.
>>> 
>>> I have a cross-platform bundle, say org.example.nativelib and one fragment
>>> for each platform:
>>> - org.example.nativelib.linux64b
>>> - org.example.nativelib.linux32b
>>> - org.example.nativelib.win7-64b
>>> - org.example.nativelib.osx64b
>>> - etc.
>>> 
>>> How can I be sure that when deploying org.example.nativelib from the OBR,
>>> the native fragment of the correct platform will be deployed?
>>> 
>>> Thanks for your help
>>> 
>>> Benoît
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>> 
>>> 




Re: OBR, bundle fragments and native code

Posted by Benoît Thiébault <th...@artenum.com>.
Hi again,

What bundle provides the osgi.native capability? When running Felix, I have the following error:

g! org.osgi.framework.BundleException: Unresolved constraint in bundle org-myapp [42]: Unable to resolve 42.0: missing requirement [42.0] org.myapp.native; (library=vtk) [caused by: Unable to resolve 43.0: missing requirement [43.0] osgi.native; (&(osgi.native.osname=MacOS)(os.native.processor=x86_64))]

I’m using Felix 4.2.1 and I’m pretty sure I’m on a 64 bits Mac (Mavericks 10.9.2)

Kind regards
Ben

Le 29 mars 2014 à 11:21, Neil Bartlett <nj...@gmail.com> a écrit :

> You cannot do this with OBR. If you can use the R5 repository format, along
> with the repoindex tool, then you can use Provide- and Require-Capability
> headers to ensure the set of libraries you need is resolved. For example
> the fragment "org.example.nativelib.osx64" would provide something custom
> like this:
> 
>    Provide-Capability: myapp.native; library=com.example.nativelib
> 
> and it would require the osgi.native capability to ensure it can only
> resolve on a single platform:
> 
>    Require-Capability: osgi.native;
> filter:="(&(osgi.native.osname=MacOS)(os.native.processor=x86_64))"
> 
> Now your core bundle just requires the myapp.native capability and the
> resolver will pick the right fragment for your runtime platform.
> 
> 
> On Sat, Mar 29, 2014 at 7:47 AM, Benoît Thiébault <th...@artenum.com>wrote:
> 
>> Hi everyone,
>> 
>> I’m willing to simplify my application deployment and plan to use an OBR.
>> On this OBR, I have deployed several bundles, including some containing
>> native code.
>> 
>> I have a cross-platform bundle, say org.example.nativelib and one fragment
>> for each platform:
>> - org.example.nativelib.linux64b
>> - org.example.nativelib.linux32b
>> - org.example.nativelib.win7-64b
>> - org.example.nativelib.osx64b
>> - etc.
>> 
>> How can I be sure that when deploying org.example.nativelib from the OBR,
>> the native fragment of the correct platform will be deployed?
>> 
>> Thanks for your help
>> 
>> Benoît
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>> 
>> 

-- 
Dr Benoît Thiébault
Project Manager

  Artenum Toulouse - Science & Groupware
  http://www.artenum.com

      Bâtiment Calfocenter
      10, rue Marguerite-Long
      31320 Castanet-Tolosan
      France
      Phone: +33 (0)5 82 95 19 00



Re: OBR, bundle fragments and native code

Posted by Benoît Thiébault <th...@artenum.com>.
I also tried with Maven Bundle Plugin 2.4.0 and have the same issue
Kind regards,
Ben

Le 31 mars 2014 à 11:18, Benoît Thiébault <th...@artenum.com> a écrit :

> OK, I’m back at work and I have been trying your snippet.
> 
> I have a compilation problems… It seems Maven Bundle Plugin has difficulties parsing the filter.
> 
> Here is the error message:
>> mvn clean install -DskipTests=true
> [INFO] Scanning for projects...
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]   
> [ERROR]   The project  (/path/to/my/project/pom.xml) has 1 error
> [ERROR]     Non-parseable POM /path/to/my/project/modules/my-module-osx64b/pom.xml: entity reference names can not start with character '(' (position: START_TAG seen ...<Require-Capability>osgi.native; filter:="(&(... @93:70)  @ line 93, column 70 -> [Help 2]
> [ERROR] 
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR] 
> [ERROR] For more information about the errors and possible solutions, please read the following articles:
> [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
> [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException
> 
> The line in the POM is:
> <Require-Capability>osgi.native; filter:="(&(osgi.native.osname=MacOS)(os.native.processor=x86_64))"</Require-Capability>
> 
> I am using the following configuration for Maven Bundle Plugin:
> <plugin>
> 	<groupId>org.apache.felix</groupId>
> 	<artifactId>maven-bundle-plugin</artifactId>
> 	<version>2.3.7</version>
> 	<extensions>true</extensions>
> </plugin>
> 
> Thanks for your help
> 
> Ben
> 
> Le 29 mars 2014 à 11:21, Neil Bartlett <nj...@gmail.com> a écrit :
> 
>> You cannot do this with OBR. If you can use the R5 repository format, along
>> with the repoindex tool, then you can use Provide- and Require-Capability
>> headers to ensure the set of libraries you need is resolved. For example
>> the fragment "org.example.nativelib.osx64" would provide something custom
>> like this:
>> 
>>   Provide-Capability: myapp.native; library=com.example.nativelib
>> 
>> and it would require the osgi.native capability to ensure it can only
>> resolve on a single platform:
>> 
>>   Require-Capability: osgi.native;
>> filter:="(&(osgi.native.osname=MacOS)(os.native.processor=x86_64))"
>> 
>> Now your core bundle just requires the myapp.native capability and the
>> resolver will pick the right fragment for your runtime platform.
>> 
>> 
>> On Sat, Mar 29, 2014 at 7:47 AM, Benoît Thiébault <th...@artenum.com>wrote:
>> 
>>> Hi everyone,
>>> 
>>> I’m willing to simplify my application deployment and plan to use an OBR.
>>> On this OBR, I have deployed several bundles, including some containing
>>> native code.
>>> 
>>> I have a cross-platform bundle, say org.example.nativelib and one fragment
>>> for each platform:
>>> - org.example.nativelib.linux64b
>>> - org.example.nativelib.linux32b
>>> - org.example.nativelib.win7-64b
>>> - org.example.nativelib.osx64b
>>> - etc.
>>> 
>>> How can I be sure that when deploying org.example.nativelib from the OBR,
>>> the native fragment of the correct platform will be deployed?
>>> 
>>> Thanks for your help
>>> 
>>> Benoît
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>> 
>>> 
> 
> -- 
> Dr Benoît Thiébault
> Project Manager
> 
>  Artenum Toulouse - Science & Groupware
>  http://www.artenum.com
> 
>      Bâtiment Calfocenter
>      10, rue Marguerite-Long
>      31320 Castanet-Tolosan
>      France
>      Phone: +33 (0)5 82 95 19 00
> 
> 

-- 
Dr Benoît Thiébault
Project Manager

  Artenum Toulouse - Science & Groupware
  http://www.artenum.com

      Bâtiment Calfocenter
      10, rue Marguerite-Long
      31320 Castanet-Tolosan
      France
      Phone: +33 (0)5 82 95 19 00



Re: OBR, bundle fragments and native code

Posted by Benoît Thiébault <th...@artenum.com>.
Indeed :-)

Here is the correct line:

<Require-Capability>osgi.native; filter:="(&amp;(osgi.native.osname=MacOS)(os.native.processor=x86_64))"</Require-Capability>

Thanks

Le 31 mars 2014 à 11:22, Neil Bartlett <nj...@gmail.com> a écrit :

> Aha. I wasn't aware you were using the bundle plugin. The XML format
> requires you to escape certain characters within the filter, for example
> "<" should be &lt; and "&" should be &amp; and so on.
> 
> 
> On Mon, Mar 31, 2014 at 10:18 AM, Benoît Thiébault <th...@artenum.com>wrote:
> 
>> OK, I’m back at work and I have been trying your snippet.
>> 
>> I have a compilation problems… It seems Maven Bundle Plugin has
>> difficulties parsing the filter.
>> 
>> Here is the error message:
>>> mvn clean install -DskipTests=true
>> [INFO] Scanning for projects...
>> [ERROR] The build could not read 1 project -> [Help 1]
>> [ERROR]
>> [ERROR]   The project  (/path/to/my/project/pom.xml) has 1 error
>> [ERROR]     Non-parseable POM
>> /path/to/my/project/modules/my-module-osx64b/pom.xml: entity reference
>> names can not start with character '(' (position: START_TAG seen
>> ...<Require-Capability>osgi.native; filter:="(&(... @93:70)  @ line 93,
>> column 70 -> [Help 2]
>> [ERROR]
>> [ERROR] To see the full stack trace of the errors, re-run Maven with the
>> -e switch.
>> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
>> [ERROR]
>> [ERROR] For more information about the errors and possible solutions,
>> please read the following articles:
>> [ERROR] [Help 1]
>> http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
>> [ERROR] [Help 2]
>> http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException
>> 
>> The line in the POM is:
>> <Require-Capability>osgi.native;
>> filter:="(&(osgi.native.osname=MacOS)(os.native.processor=x86_64))"</Require-Capability>
>> 
>> I am using the following configuration for Maven Bundle Plugin:
>> <plugin>
>>        <groupId>org.apache.felix</groupId>
>>        <artifactId>maven-bundle-plugin</artifactId>
>>        <version>2.3.7</version>
>>        <extensions>true</extensions>
>> </plugin>
>> 
>> Thanks for your help
>> 
>> Ben
>> 
>> Le 29 mars 2014 à 11:21, Neil Bartlett <nj...@gmail.com> a écrit :
>> 
>>> You cannot do this with OBR. If you can use the R5 repository format,
>> along
>>> with the repoindex tool, then you can use Provide- and Require-Capability
>>> headers to ensure the set of libraries you need is resolved. For example
>>> the fragment "org.example.nativelib.osx64" would provide something custom
>>> like this:
>>> 
>>>   Provide-Capability: myapp.native; library=com.example.nativelib
>>> 
>>> and it would require the osgi.native capability to ensure it can only
>>> resolve on a single platform:
>>> 
>>>   Require-Capability: osgi.native;
>>> filter:="(&(osgi.native.osname=MacOS)(os.native.processor=x86_64))"
>>> 
>>> Now your core bundle just requires the myapp.native capability and the
>>> resolver will pick the right fragment for your runtime platform.
>>> 
>>> 
>>> On Sat, Mar 29, 2014 at 7:47 AM, Benoît Thiébault <thiebault@artenum.com
>>> wrote:
>>> 
>>>> Hi everyone,
>>>> 
>>>> I’m willing to simplify my application deployment and plan to use an
>> OBR.
>>>> On this OBR, I have deployed several bundles, including some containing
>>>> native code.
>>>> 
>>>> I have a cross-platform bundle, say org.example.nativelib and one
>> fragment
>>>> for each platform:
>>>> - org.example.nativelib.linux64b
>>>> - org.example.nativelib.linux32b
>>>> - org.example.nativelib.win7-64b
>>>> - org.example.nativelib.osx64b
>>>> - etc.
>>>> 
>>>> How can I be sure that when deploying org.example.nativelib from the
>> OBR,
>>>> the native fragment of the correct platform will be deployed?
>>>> 
>>>> Thanks for your help
>>>> 
>>>> Benoît
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>> 
>>>> 
>> 
>> --
>> Dr Benoît Thiébault
>> Project Manager
>> 
>>  Artenum Toulouse - Science & Groupware
>>  http://www.artenum.com
>> 
>>      Bâtiment Calfocenter
>>      10, rue Marguerite-Long
>>      31320 Castanet-Tolosan
>>      France
>>      Phone: +33 (0)5 82 95 19 00
>> 
>> 
>> 

-- 
Dr Benoît Thiébault
Project Manager

  Artenum Toulouse - Science & Groupware
  http://www.artenum.com

      Bâtiment Calfocenter
      10, rue Marguerite-Long
      31320 Castanet-Tolosan
      France
      Phone: +33 (0)5 82 95 19 00



Re: OBR, bundle fragments and native code

Posted by Neil Bartlett <nj...@gmail.com>.
Aha. I wasn't aware you were using the bundle plugin. The XML format
requires you to escape certain characters within the filter, for example
"<" should be &lt; and "&" should be &amp; and so on.


On Mon, Mar 31, 2014 at 10:18 AM, Benoît Thiébault <th...@artenum.com>wrote:

> OK, I’m back at work and I have been trying your snippet.
>
> I have a compilation problems… It seems Maven Bundle Plugin has
> difficulties parsing the filter.
>
> Here is the error message:
> > mvn clean install -DskipTests=true
> [INFO] Scanning for projects...
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]
> [ERROR]   The project  (/path/to/my/project/pom.xml) has 1 error
> [ERROR]     Non-parseable POM
> /path/to/my/project/modules/my-module-osx64b/pom.xml: entity reference
> names can not start with character '(' (position: START_TAG seen
> ...<Require-Capability>osgi.native; filter:="(&(... @93:70)  @ line 93,
> column 70 -> [Help 2]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the
> -e switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions,
> please read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
> [ERROR] [Help 2]
> http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException
>
> The line in the POM is:
> <Require-Capability>osgi.native;
> filter:="(&(osgi.native.osname=MacOS)(os.native.processor=x86_64))"</Require-Capability>
>
> I am using the following configuration for Maven Bundle Plugin:
> <plugin>
>         <groupId>org.apache.felix</groupId>
>         <artifactId>maven-bundle-plugin</artifactId>
>         <version>2.3.7</version>
>         <extensions>true</extensions>
> </plugin>
>
> Thanks for your help
>
> Ben
>
> Le 29 mars 2014 à 11:21, Neil Bartlett <nj...@gmail.com> a écrit :
>
> > You cannot do this with OBR. If you can use the R5 repository format,
> along
> > with the repoindex tool, then you can use Provide- and Require-Capability
> > headers to ensure the set of libraries you need is resolved. For example
> > the fragment "org.example.nativelib.osx64" would provide something custom
> > like this:
> >
> >    Provide-Capability: myapp.native; library=com.example.nativelib
> >
> > and it would require the osgi.native capability to ensure it can only
> > resolve on a single platform:
> >
> >    Require-Capability: osgi.native;
> > filter:="(&(osgi.native.osname=MacOS)(os.native.processor=x86_64))"
> >
> > Now your core bundle just requires the myapp.native capability and the
> > resolver will pick the right fragment for your runtime platform.
> >
> >
> > On Sat, Mar 29, 2014 at 7:47 AM, Benoît Thiébault <thiebault@artenum.com
> >wrote:
> >
> >> Hi everyone,
> >>
> >> I’m willing to simplify my application deployment and plan to use an
> OBR.
> >> On this OBR, I have deployed several bundles, including some containing
> >> native code.
> >>
> >> I have a cross-platform bundle, say org.example.nativelib and one
> fragment
> >> for each platform:
> >> - org.example.nativelib.linux64b
> >> - org.example.nativelib.linux32b
> >> - org.example.nativelib.win7-64b
> >> - org.example.nativelib.osx64b
> >> - etc.
> >>
> >> How can I be sure that when deploying org.example.nativelib from the
> OBR,
> >> the native fragment of the correct platform will be deployed?
> >>
> >> Thanks for your help
> >>
> >> Benoît
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> >> For additional commands, e-mail: users-help@felix.apache.org
> >>
> >>
>
> --
> Dr Benoît Thiébault
> Project Manager
>
>   Artenum Toulouse - Science & Groupware
>   http://www.artenum.com
>
>       Bâtiment Calfocenter
>       10, rue Marguerite-Long
>       31320 Castanet-Tolosan
>       France
>       Phone: +33 (0)5 82 95 19 00
>
>
>

Re: OBR, bundle fragments and native code

Posted by Benoît Thiébault <th...@artenum.com>.
OK, I’m back at work and I have been trying your snippet.

I have a compilation problems… It seems Maven Bundle Plugin has difficulties parsing the filter.

Here is the error message:
> mvn clean install -DskipTests=true
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project  (/path/to/my/project/pom.xml) has 1 error
[ERROR]     Non-parseable POM /path/to/my/project/modules/my-module-osx64b/pom.xml: entity reference names can not start with character '(' (position: START_TAG seen ...<Require-Capability>osgi.native; filter:="(&(... @93:70)  @ line 93, column 70 -> [Help 2]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException

The line in the POM is:
<Require-Capability>osgi.native; filter:="(&(osgi.native.osname=MacOS)(os.native.processor=x86_64))"</Require-Capability>

I am using the following configuration for Maven Bundle Plugin:
<plugin>
	<groupId>org.apache.felix</groupId>
	<artifactId>maven-bundle-plugin</artifactId>
	<version>2.3.7</version>
	<extensions>true</extensions>
</plugin>

Thanks for your help

Ben

Le 29 mars 2014 à 11:21, Neil Bartlett <nj...@gmail.com> a écrit :

> You cannot do this with OBR. If you can use the R5 repository format, along
> with the repoindex tool, then you can use Provide- and Require-Capability
> headers to ensure the set of libraries you need is resolved. For example
> the fragment "org.example.nativelib.osx64" would provide something custom
> like this:
> 
>    Provide-Capability: myapp.native; library=com.example.nativelib
> 
> and it would require the osgi.native capability to ensure it can only
> resolve on a single platform:
> 
>    Require-Capability: osgi.native;
> filter:="(&(osgi.native.osname=MacOS)(os.native.processor=x86_64))"
> 
> Now your core bundle just requires the myapp.native capability and the
> resolver will pick the right fragment for your runtime platform.
> 
> 
> On Sat, Mar 29, 2014 at 7:47 AM, Benoît Thiébault <th...@artenum.com>wrote:
> 
>> Hi everyone,
>> 
>> I’m willing to simplify my application deployment and plan to use an OBR.
>> On this OBR, I have deployed several bundles, including some containing
>> native code.
>> 
>> I have a cross-platform bundle, say org.example.nativelib and one fragment
>> for each platform:
>> - org.example.nativelib.linux64b
>> - org.example.nativelib.linux32b
>> - org.example.nativelib.win7-64b
>> - org.example.nativelib.osx64b
>> - etc.
>> 
>> How can I be sure that when deploying org.example.nativelib from the OBR,
>> the native fragment of the correct platform will be deployed?
>> 
>> Thanks for your help
>> 
>> Benoît
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>> 
>> 

-- 
Dr Benoît Thiébault
Project Manager

  Artenum Toulouse - Science & Groupware
  http://www.artenum.com

      Bâtiment Calfocenter
      10, rue Marguerite-Long
      31320 Castanet-Tolosan
      France
      Phone: +33 (0)5 82 95 19 00



Re: OBR, bundle fragments and native code

Posted by Neil Bartlett <nj...@gmail.com>.
You cannot do this with OBR. If you can use the R5 repository format, along
with the repoindex tool, then you can use Provide- and Require-Capability
headers to ensure the set of libraries you need is resolved. For example
the fragment "org.example.nativelib.osx64" would provide something custom
like this:

    Provide-Capability: myapp.native; library=com.example.nativelib

and it would require the osgi.native capability to ensure it can only
resolve on a single platform:

    Require-Capability: osgi.native;
filter:="(&(osgi.native.osname=MacOS)(os.native.processor=x86_64))"

Now your core bundle just requires the myapp.native capability and the
resolver will pick the right fragment for your runtime platform.


On Sat, Mar 29, 2014 at 7:47 AM, Benoît Thiébault <th...@artenum.com>wrote:

> Hi everyone,
>
> I’m willing to simplify my application deployment and plan to use an OBR.
> On this OBR, I have deployed several bundles, including some containing
> native code.
>
> I have a cross-platform bundle, say org.example.nativelib and one fragment
> for each platform:
> - org.example.nativelib.linux64b
> - org.example.nativelib.linux32b
> - org.example.nativelib.win7-64b
> - org.example.nativelib.osx64b
> - etc.
>
> How can I be sure that when deploying org.example.nativelib from the OBR,
> the native fragment of the correct platform will be deployed?
>
> Thanks for your help
>
> Benoît
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: OBR, bundle fragments and native code

Posted by Ferry Huberts <ma...@hupie.com>.

On 29/03/14 08:47, Benoît Thiébault wrote:
> Hi everyone,
>
> I’m willing to simplify my application deployment and plan to use an OBR. On this OBR, I have deployed several bundles, including some containing native code.
>
> I have a cross-platform bundle, say org.example.nativelib and one fragment for each platform:
> - org.example.nativelib.linux64b
> - org.example.nativelib.linux32b
> - org.example.nativelib.win7-64b
> - org.example.nativelib.osx64b
> - etc.
>
> How can I be sure that when deploying org.example.nativelib from the OBR, the native fragment of the correct platform will be deployed?
>

Include them in the bundle itself.

An example from my jnotify project:

> Bundle-NativeCode: lib/linux/i686/libjnotify.so;osname=Linux;processor=x86,\
> 	lib/linux/x86_64/libjnotify.so;osname=Linux;processor=x86-64


-- 
Ferry Huberts

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