You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Tim Vissers <ti...@gmail.com> on 2015/03/25 13:10:22 UTC

Bundle resolving not working using the repository specification

Dear,

we created a very simple project containing two bundles: service and
service-user. The second one depending on the first one.



A. We are trying to have repository support for bundle resolving.

How we created the repository.xml:
1) by hand, according to the repository specification
2) by using the maven bundle plugin (seems to be not following the
repository specification, but some felix-specific syntax)
3) by using the org.osgi.impl.bundle.repoindex.cli.jar

Using the 2) bundle resolving works correctly. Deploying service-user
results also in service being installed/started.
However, this repository syntax is felix-specific and it doesn't (?)
support subsystems as resources which is what we try to do in the end.

So, using 1) bundle resolving does not work correctly. Deploying
service-user results in an unsatisfied constraint:
    obr:repos add file:../repository/repo.xml
    obr:deploy be.aca.service-user
What are we doing wrong here?
We hosted the project on https://github.com/timv2/OSGISubsystemTest. It is
very easy to set up.
The README also explains the situation. The actual repository file we
created is
https://github.com/timv2/OSGISubsystemTest/blob/master/runner/repository/repo.xml

Can someone give some feedback on this?



B. The next step would be to have support for subsystems in the repository.
Once we get A. to work, it comes down to how to create the repository xml
with subsystems. That might resolve in a next thread on the mailinglist :)

Best regards,
Tim

Re: Bundle resolving not working using the repository specification

Posted by kameshsampath <ka...@liferay.com>.
>From simple test I made with my work sample, I tried adding the following to
*repo.xml* To `API Bundle` (be.aca.service.api)​```                 ```To
`Provider or Requirer bundle` (be.aca.service-user)```            ```In my
perception the API bundle exporting the packages but the wiring bundles does
not know which host exports the API so we need to define the `wiring.host`
name in the API bundle and list the services that provider or requirer might
use.HTH



--
View this message in context: http://aries.15396.n3.nabble.com/Bundle-resolving-not-working-using-the-repository-specification-tp4030325p4030333.html
Sent from the Aries - User mailing list archive at Nabble.com.

Re: Bundle resolving not working using the repository specification

Posted by Jeroen Baekelandt <yr...@gmail.com>.
Isn't the purpose of osgi.wiring.host namespace to expose the
information in the bundle headers for the purpose of fragments
(according to core spec chapter 8.5)?

In the repo.xml example, the be.aca.service resource does have a
capability osgi.wiring.package that exposes be.aca.service.api. Imho,
that is sufficient for the repository to know that be.aca.service is the
bundle that exposes this package. The be.aca.service-user bundle has a
requirement for package be.aca.service.api, so it should be able to
resolve to the be.aca.service bundle.

This seems to be a bit of a detour to get to the actual thing we're
trying to achieve, and that is to also put subsystems in the repo.xml
(manually for now, because there is no tooling yet), and being able to
deploy a top-level subsystem which then 'pulls in' its dependencies from
the repo automatically. But since we can't even get it to work with
bundles, we were wondering if it could ever work with subsystems.

Besides this, we're also not sure how to put subsystems in the repo.xml,
how the capabilities and requirements are to be expressed.

(btw, I'm working on the same issue as Tim ;-) )

Thanks again for any help!

Jeroen


On Thu, Mar 26, 2015, at 06:00, Kamesh Sampath wrote:
> From simple test I made with my work sample, I tried adding the
> following to *repo.xml*
>
> To "API Bundle (be.aca.service.api)"
>
>
> " <capabilitynamespace="osgi.wiring.host">


> <attributename="osgi.wiring.host"value="be.aca.service"/>


> <attributename="bundle-version"type="Version"value="0.0.1-SNAPSHOT"/>


> </capability>


> "


>


> To "Provider or Requirer bundle (be.aca.service-user)"


> "


> <capabilitynamespace="osgi.service">


> <attributename="objectClass"type="List&lt;String&gt;"value="be.aca.service.api"/>


>
> </capability>


> "


> In my perception the API bundle exporting the packages but the wiring
> bundles does not know which host exports the API so we need to define
> the `wiring.host` name in the API bundle and list the services that
> provider or requirer might use.


> HTH


>
>
>
>
> — *Kamesh Sampath* Sr.Architect, Liferay India Twitter[1] |LinkedIn[2]
>
>> On 25-Mar-2015, at 6:35 pm, Tim Vissers
>> <ti...@gmail.com> wrote:
>>
>> Ok, that I understand.
>>
>> However in my question we're not yet using subsystems, the question
>> (A) is just about bundle resolving using the repo.xml, not subsystems
>>
>> 2015-03-25 13:52 GMT+01:00 Kamesh Sampath
>> <ka...@liferay.com>:
>>> sorry my bad i did not notice it.
>>>
>>> but right now we can’t generate subsystem indexing in the repo using
>>> the available tools, even my personal experience as you had i was
>>> able to do it only via maven:bundle indexing which tries to resolve
>>> the subsystem content form the maven repo, the repoindex does not
>>> index the esa as it does not know how/what to index, currently even
>>> in OSGi spec we dont have the right defs for it.
>>>
>>> @David, please feel to add if i had missed any point.
>>>
>>>
>>> — *Kamesh Sampath* Sr.Architect, Liferay India Twitter[3]
>>> |LinkedIn[4]
>>>
>>>
>>>>
>>>> On 25-Mar-2015, at 6:12 pm, Tim Vissers <ti...@gmail.com>
>>>> wrote:
>>>>
>>>>
>>>> It's not a bundle, it's a api package that is exported in
>>>> be.aca.service and imported in be.aca.service-user. en t Tim
>>>>
>>>>
>>>>
>>>> 2015-03-25 13:38 GMT+01:00 Kamesh Sampath
>>>> <ka...@liferay.com>:
>>>>
>>>>> am not seeing be.aca.service.api in the obr:list, where is that
>>>>> bundle ?
>>>>>
>>>>>
>>>>> — *Kamesh Sampath* Sr.Architect, Liferay India Twitter[5]
>>>>> |LinkedIn[6]
>>>>>
>>>>>
>>>>>> On 25-Mar-2015, at 6:02 pm, Tim Vissers <ti...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>
>>>>>> be.aca.service.api
>>>>>
>>>>
>>>>
>>>
>>
>



Links:

  1. https://twitter.com/@kamesh_Sampath
  2. http://in.linkedin.com/pub/kamesh-sampath/4b/934/338/
  3. https://twitter.com/@kamesh_Sampath
  4. http://in.linkedin.com/pub/kamesh-sampath/4b/934/338/
  5. https://twitter.com/@kamesh_Sampath
  6. http://in.linkedin.com/pub/kamesh-sampath/4b/934/338/

Re: Bundle resolving not working using the repository specification

Posted by Kamesh Sampath <ka...@liferay.com>.
From simple test I made with my work sample, I tried adding the following to *repo.xml* 

To "API Bundle (be.aca.service.api)​"


"
  <capability namespace="osgi.wiring.host">

      <attribute name="osgi.wiring.host" value="be.aca.service"/>

      <attribute name="bundle-version" type="Version" value="0.0.1-SNAPSHOT"/>

   </capability>

"



To "Provider or Requirer bundle (be.aca.service-user)"

"

  <capability namespace="osgi.service">

      <attribute name="objectClass" type="List&lt;String&gt;" value="be.aca.service.api"/>


    </capability>

"

In my perception the API bundle exporting the packages but the wiring bundles does not know which host exports the API so we need to define the `wiring.host` name in the API bundle and list the services that provider or requirer might use.

HTH



— 
Kamesh Sampath
Sr.Architect,  Liferay India
Twitter <ht...@kamesh_Sampath> | LinkedIn <http://in.linkedin.com/pub/kamesh-sampath/4b/934/338/>
> On 25-Mar-2015, at 6:35 pm, Tim Vissers <ti...@gmail.com> wrote:
> 
> Ok, that I understand.
> 
> However in my question we're not yet using subsystems, the question (A) is just about bundle resolving using the repo.xml, not subsystems
> 
> 2015-03-25 13:52 GMT+01:00 Kamesh Sampath <kamesh.sampath@liferay.com <ma...@liferay.com>>:
> sorry my bad i did not notice it.
> 
> but right now we can’t generate subsystem indexing in the repo using the available tools, even my personal experience as you had i was able to do it only via maven:bundle indexing which tries to resolve the subsystem content form the maven repo, the repoindex does not index the esa as it does not know how/what to index, currently even in OSGi spec we dont have the right defs for it.
> 
> @David, please feel to add if i had missed any point.
> 
> — 
> Kamesh Sampath
> Sr.Architect,  Liferay India
> Twitter <ht...@kamesh_Sampath> | LinkedIn <http://in.linkedin.com/pub/kamesh-sampath/4b/934/338/>
>> On 25-Mar-2015, at 6:12 pm, Tim Vissers <tim.vissers@gmail.com <ma...@gmail.com>> wrote:
>> 
>> It's not a bundle, it's a api package that is exported in be.aca.service and imported in be.aca.service-user.
>> en t
>> Tim
>> 
>> 2015-03-25 13:38 GMT+01:00 Kamesh Sampath <kamesh.sampath@liferay.com <ma...@liferay.com>>:
>> am not seeing be.aca.service.api in the obr:list, where is that bundle ?
>> 
>> — 
>> Kamesh Sampath
>> Sr.Architect,  Liferay India
>> Twitter <ht...@kamesh_Sampath> | LinkedIn <http://in.linkedin.com/pub/kamesh-sampath/4b/934/338/>
>>> On 25-Mar-2015, at 6:02 pm, Tim Vissers <tim.vissers@gmail.com <ma...@gmail.com>> wrote:
>>> 
>>> be.aca.service.api
>> 
>> 
> 
> 


Re: Bundle resolving not working using the repository specification

Posted by Tim Vissers <ti...@gmail.com>.
Ok, that I understand.

However in my question we're not yet using subsystems, the question (A) is
just about bundle resolving using the repo.xml, not subsystems

2015-03-25 13:52 GMT+01:00 Kamesh Sampath <ka...@liferay.com>:

> sorry my bad i did not notice it.
>
> but right now we can’t generate subsystem indexing in the repo using the
> available tools, even my personal experience as you had i was able to do it
> only via maven:bundle indexing which tries to resolve the subsystem content
> form the maven repo, the repoindex does not index the esa as it does not
> know how/what to index, currently even in OSGi spec we dont have the right
> defs for it.
>
> @David, please feel to add if i had missed any point.
>
> —
> *Kamesh Sampath*
> Sr.Architect,  Liferay India
> Twitter <ht...@kamesh_Sampath> | LinkedIn
> <http://in.linkedin.com/pub/kamesh-sampath/4b/934/338/>
>
> On 25-Mar-2015, at 6:12 pm, Tim Vissers <ti...@gmail.com> wrote:
>
> It's not a bundle, it's a api package that is exported in be.aca.service
> and imported in be.aca.service-user.
> en t
> Tim
>
> 2015-03-25 13:38 GMT+01:00 Kamesh Sampath <ka...@liferay.com>:
>
>> am not seeing be.aca.service.api in the obr:list, where is that bundle ?
>>
>> —
>> *Kamesh Sampath*
>> Sr.Architect,  Liferay India
>> Twitter <ht...@kamesh_Sampath> | LinkedIn
>> <http://in.linkedin.com/pub/kamesh-sampath/4b/934/338/>
>>
>> On 25-Mar-2015, at 6:02 pm, Tim Vissers <ti...@gmail.com> wrote:
>>
>> be.aca.service.api
>>
>>
>>
>
>

Re: Bundle resolving not working using the repository specification

Posted by Kamesh Sampath <ka...@liferay.com>.
sorry my bad i did not notice it.

but right now we can’t generate subsystem indexing in the repo using the available tools, even my personal experience as you had i was able to do it only via maven:bundle indexing which tries to resolve the subsystem content form the maven repo, the repoindex does not index the esa as it does not know how/what to index, currently even in OSGi spec we dont have the right defs for it.

@David, please feel to add if i had missed any point.

— 
Kamesh Sampath
Sr.Architect,  Liferay India
Twitter <ht...@kamesh_Sampath> | LinkedIn <http://in.linkedin.com/pub/kamesh-sampath/4b/934/338/>
> On 25-Mar-2015, at 6:12 pm, Tim Vissers <ti...@gmail.com> wrote:
> 
> It's not a bundle, it's a api package that is exported in be.aca.service and imported in be.aca.service-user.
> en t
> Tim
> 
> 2015-03-25 13:38 GMT+01:00 Kamesh Sampath <kamesh.sampath@liferay.com <ma...@liferay.com>>:
> am not seeing be.aca.service.api in the obr:list, where is that bundle ?
> 
> — 
> Kamesh Sampath
> Sr.Architect,  Liferay India
> Twitter <ht...@kamesh_Sampath> | LinkedIn <http://in.linkedin.com/pub/kamesh-sampath/4b/934/338/>
>> On 25-Mar-2015, at 6:02 pm, Tim Vissers <tim.vissers@gmail.com <ma...@gmail.com>> wrote:
>> 
>> be.aca.service.api
> 
> 


Re: Bundle resolving not working using the repository specification

Posted by Tim Vissers <ti...@gmail.com>.
It's not a bundle, it's a api package that is exported in be.aca.service
and imported in be.aca.service-user.

Tim

2015-03-25 13:38 GMT+01:00 Kamesh Sampath <ka...@liferay.com>:

> am not seeing be.aca.service.api in the obr:list, where is that bundle ?
>
> —
> *Kamesh Sampath*
> Sr.Architect,  Liferay India
> Twitter <ht...@kamesh_Sampath> | LinkedIn
> <http://in.linkedin.com/pub/kamesh-sampath/4b/934/338/>
>
> On 25-Mar-2015, at 6:02 pm, Tim Vissers <ti...@gmail.com> wrote:
>
> be.aca.service.api
>
>
>

Re: Bundle resolving not working using the repository specification

Posted by Kamesh Sampath <ka...@liferay.com>.
am not seeing be.aca.service.api in the obr:list, where is that bundle ?

— 
Kamesh Sampath
Sr.Architect,  Liferay India
Twitter <ht...@kamesh_Sampath> | LinkedIn <http://in.linkedin.com/pub/kamesh-sampath/4b/934/338/>
> On 25-Mar-2015, at 6:02 pm, Tim Vissers <ti...@gmail.com> wrote:
> 
> be.aca.service.api


Re: Bundle resolving not working using the repository specification

Posted by Tim Vissers <ti...@gmail.com>.
It's actually the dependency bundle resolving:

obr:repos add file:../repository/repo.xml
g! obr:list
be.aca.service (0.0.1.SNAPSHOT)
be.aca.service-user (0.0.1.SNAPSHOT)
g! obr:deploy be.aca.service-user
Unsatisfied requirement(s):
---------------------------
   (&(package=be.aca.service.api)(!(version>=1.0.0)))
      null



2015-03-25 13:15 GMT+01:00 David Bosschaert <da...@gmail.com>:

> It might be helpful to post the actual exception you are getting.
>
> David
>
> On 25 March 2015 at 13:10, Tim Vissers <ti...@gmail.com> wrote:
> > Dear,
> >
> > we created a very simple project containing two bundles: service and
> > service-user. The second one depending on the first one.
> >
> >
> >
> > A. We are trying to have repository support for bundle resolving.
> >
> > How we created the repository.xml:
> > 1) by hand, according to the repository specification
> > 2) by using the maven bundle plugin (seems to be not following the
> > repository specification, but some felix-specific syntax)
> > 3) by using the org.osgi.impl.bundle.repoindex.cli.jar
> >
> > Using the 2) bundle resolving works correctly. Deploying service-user
> > results also in service being installed/started.
> > However, this repository syntax is felix-specific and it doesn't (?)
> support
> > subsystems as resources which is what we try to do in the end.
> >
> > So, using 1) bundle resolving does not work correctly. Deploying
> > service-user results in an unsatisfied constraint:
> >     obr:repos add file:../repository/repo.xml
> >     obr:deploy be.aca.service-user
> > What are we doing wrong here?
> > We hosted the project on https://github.com/timv2/OSGISubsystemTest. It
> is
> > very easy to set up.
> > The README also explains the situation. The actual repository file we
> > created is
> >
> https://github.com/timv2/OSGISubsystemTest/blob/master/runner/repository/repo.xml
> >
> > Can someone give some feedback on this?
> >
> >
> >
> > B. The next step would be to have support for subsystems in the
> repository.
> > Once we get A. to work, it comes down to how to create the repository xml
> > with subsystems. That might resolve in a next thread on the mailinglist
> :)
> >
> > Best regards,
> > Tim
> >
> >
>

Re: Bundle resolving not working using the repository specification

Posted by David Bosschaert <da...@gmail.com>.
It might be helpful to post the actual exception you are getting.

David

On 25 March 2015 at 13:10, Tim Vissers <ti...@gmail.com> wrote:
> Dear,
>
> we created a very simple project containing two bundles: service and
> service-user. The second one depending on the first one.
>
>
>
> A. We are trying to have repository support for bundle resolving.
>
> How we created the repository.xml:
> 1) by hand, according to the repository specification
> 2) by using the maven bundle plugin (seems to be not following the
> repository specification, but some felix-specific syntax)
> 3) by using the org.osgi.impl.bundle.repoindex.cli.jar
>
> Using the 2) bundle resolving works correctly. Deploying service-user
> results also in service being installed/started.
> However, this repository syntax is felix-specific and it doesn't (?) support
> subsystems as resources which is what we try to do in the end.
>
> So, using 1) bundle resolving does not work correctly. Deploying
> service-user results in an unsatisfied constraint:
>     obr:repos add file:../repository/repo.xml
>     obr:deploy be.aca.service-user
> What are we doing wrong here?
> We hosted the project on https://github.com/timv2/OSGISubsystemTest. It is
> very easy to set up.
> The README also explains the situation. The actual repository file we
> created is
> https://github.com/timv2/OSGISubsystemTest/blob/master/runner/repository/repo.xml
>
> Can someone give some feedback on this?
>
>
>
> B. The next step would be to have support for subsystems in the repository.
> Once we get A. to work, it comes down to how to create the repository xml
> with subsystems. That might resolve in a next thread on the mailinglist :)
>
> Best regards,
> Tim
>
>