You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by San, Matías <ma...@yahoo.com.ar> on 2012/03/10 01:23:33 UTC

OBR resolver knows about a requirement of a missing requirement

Hi everybody, 
first of all sorry about the odd mail subject, I will try to explain
myself better.

The context of the problem:
=================

I have the following bundles:
Main 
   Depends on (packages): Console, InterConsole, Runner
Console: 
   Depends on: InterConsole
   Exports (package): Console
InterConsole:
   Exports: InterConsole
Runner:
   Depends on: InterConsole, InterRunner
   Exports: Runner
InterRunner:
   Exports: InterRunner
//////////////////////////

I have the following OBR repositories:
Repo1: (contains) Main, Console, InterConsole
Repo2: Runner
Repo3: InterRunner
//////////////////////////

Then I have this (pseudo)code/logic:

1- Install Repo1 in OBR repository admin
2- discover resource Main
3- get a new resolver
4- try to deploy Main
5- If there are missing dependencies, print them, else go to pont 9
6- Find repository that contains missing dependencies
7- Install repository found
8- Go to point 3
9- Bundle deployed

The run output:
==========

The execution of the logic just mentioned prints this:
Got new resolver
Missing dependency: InterRunner
Missing dependency: Runner
Installed Repository 3
Installed Repository 2
Got new resolver
Bundle deployed

The question/problem:
===============
How is possible that the first resolver knows about the missing
dependency InterRunner if the Runner is not known yet???!!!

Any thoughts???

Thank you in advance for taking the time to read and give any thought to
my problem.
Regards

Re: OBR resolver knows about a requirement of a missing requirement

Posted by "San Martín, Matías" <ma...@yahoo.com.ar>.
El 13/03/12 00:19, Richard S. Hall escribió:
> On 3/11/12 12:27 , matias san martin wrote:
>> Hi Richard,
>>
>> I want to thank you again for taking the time to analyze my problem.
>> I attach a .zip file with the following content:
>>
>> 1- Repositories/
>> 2- test.osgi.obr.resolver.main/
>> 3- org.osgi.service.obr-1.0.2.jar
>> 4- test.osgi.obr.resolver.main_1.0.0.jar
>>
>>
>> 1- Is a directory with the repositories and bundles that are being 
>> used (repo1, repo2 and repo3 as defined in my previous mails)
>> 2- I the source (Eclipse project) of the bundle I'm using to resolve 
>> the dependencies (logic described in my previous mails)
>> 3- Is the bundle defining the OBR service interface (is the same that 
>> can be downloaded from felix's download page [1], I just add it for 
>> completeness).
>> 4- Is the compiled into a bundle version of 2
>>
>> I'm using felix framework 4.0.2.
>>
>> The steps to reproduce my problems are:
>>
>> 1- Copy Repositories/ to the framework's runtime current directory 
>> (./). This base directory is hardcoded in the 
>> test.osgi.obr.resolver.main_1.0.0.jar bundle, you can change if you 
>> want (in 
>> test.osgi.obr.resolver.main/src/test/osgi/obr/resolver/main/impl/Resolutor.java) 
>> but you will need to regenerate the bundle.
>> 2- Start the felix framework 4.0.2
>>
>> 3- Install and start the OBR api bundle (org.osgi.service.obr-1.0.2.jar)
>> 4- Install and start the bundle test.osgi.obr.resolver.main_1.0.0.jar
>> 5- If everything is ok, you should see an output like:
>> -----------------------
>> Adding new repository: ./Repositories/repo1/repository.xml
>> Found 1 resources
>>
>> R Id: test.osgi.dynload.bundle.main/1.0.0, SimbolicName: 
>> test.osgi.dynload.bundle.main. str: 
>> org.apache.felix.bundlerepository.impl.wrapper.ResourceWrapper@5f49d886
>> Getting a new resolver
>> Number of unsatisfied requirements: 1
>> Unable to resolve Name: package, filter: 
>> (&(package=test.osgi.dynload.bundle.runner.thread)(version>=1.0.0)(!(version>=2.0.0)))
>> Adding new repository: ./Repositories/repo2/repository.xml
>> Getting a new resolver
>> Number of unsatisfied requirements: 2
>> Unable to resolve Name: package, filter: 
>> (&(package=test.osgi.dynload.bundle.inter.runner)(version>=1.0.0)(!(version>=2.0.0)))
>> Unable to resolve Name: package, filter: 
>> (&(package=test.osgi.dynload.bundle.runner.thread)(version>=1.0.0)(!(version>=2.0.0)))
>> Adding new repository: ./Repositories/repo3/repository.xml
>> Adding new repository: ./Repositories/repo2/repository.xml
>> Getting a new resolver
>> Resource: successfully deployed
>> g! Llamando a echoer
>> Echooooooo, cuenta: 1
>>
>> -----------------------
>>
>> Hope you can figure out which is the "problem" because certainly I 
>> can't Regards and thanks again
>
> What this is doing is correct. The first repository is missing a 
> provider for main's import of the ...runner.thread package, which is 
> the first unsatisfied requirement you see. Then you add the second 
> repo which has a provider for ...runner.thread, but that provider 
> imports the ...inter.runner package which cannot be satisfied in 
> either repo1 or repo2.
>
> So, you end up with two unsatisfied requirements on your second 
> resolve attempt, one for the main's import of ...runner.thread and one 
> for runner.thread's import of ...inter.runner, which is what you see 
> above. Perhaps you are confused because you see two unsatisfied 
> requirements here and you were expecting to see one. But two is 
> correct since neither import from the two different bundles could be 
> resolved.
>
> On the third attempt you add both the repo2 and repo3 (although 
> technically you don't need to add repo2 again, since you already added 
> it). After that, everything can be satisfied, which is correct.
>
> -> richard
>

Now that you mention it, it seems so obvious. I didn't get that the 
runner.thread dependency will appear again as an unresolved dependency 
since it couldn't be resolved because the inter.runner is missing.
Thank you for the feed-back!


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


Re: OBR resolver knows about a requirement of a missing requirement

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 3/11/12 12:27 , matias san martin wrote:
> Hi Richard,
>
> I want to thank you again for taking the time to analyze my problem.
> I attach a .zip file with the following content:
>
> 1- Repositories/
> 2- test.osgi.obr.resolver.main/
> 3- org.osgi.service.obr-1.0.2.jar
> 4- test.osgi.obr.resolver.main_1.0.0.jar
>
>
> 1- Is a directory with the repositories and bundles that are being used (repo1, repo2 and repo3 as defined in my previous mails)
> 2- I the source (Eclipse project) of the bundle I'm using to resolve the dependencies (logic described in my previous mails)
> 3- Is the bundle defining the OBR service interface (is the same that can be downloaded from felix's download page [1], I just add it for completeness).
> 4- Is the compiled into a bundle version of 2
>
> I'm using felix framework 4.0.2.
>
> The steps to reproduce my problems are:
>
> 1- Copy Repositories/ to the framework's runtime current directory (./). This base directory is hardcoded in the test.osgi.obr.resolver.main_1.0.0.jar bundle, you can change if you want (in test.osgi.obr.resolver.main/src/test/osgi/obr/resolver/main/impl/Resolutor.java) but you will need to regenerate the bundle.
> 2- Start the felix framework 4.0.2
>
> 3- Install and start the OBR api bundle (org.osgi.service.obr-1.0.2.jar)
> 4- Install and start the bundle test.osgi.obr.resolver.main_1.0.0.jar
> 5- If everything is ok, you should see an output like:
> -----------------------
> Adding new repository: ./Repositories/repo1/repository.xml
> Found 1 resources
>
> R Id: test.osgi.dynload.bundle.main/1.0.0, SimbolicName: test.osgi.dynload.bundle.main. str: org.apache.felix.bundlerepository.impl.wrapper.ResourceWrapper@5f49d886
> Getting a new resolver
> Number of unsatisfied requirements: 1
> Unable to resolve Name: package, filter: (&(package=test.osgi.dynload.bundle.runner.thread)(version>=1.0.0)(!(version>=2.0.0)))
> Adding new repository: ./Repositories/repo2/repository.xml
> Getting a new resolver
> Number of unsatisfied requirements: 2
> Unable to resolve Name: package, filter: (&(package=test.osgi.dynload.bundle.inter.runner)(version>=1.0.0)(!(version>=2.0.0)))
> Unable to resolve Name: package, filter: (&(package=test.osgi.dynload.bundle.runner.thread)(version>=1.0.0)(!(version>=2.0.0)))
> Adding new repository: ./Repositories/repo3/repository.xml
> Adding new repository: ./Repositories/repo2/repository.xml
> Getting a new resolver
> Resource: successfully deployed
> g! Llamando a echoer
> Echooooooo, cuenta: 1
>
> -----------------------
>
> Hope you can figure out which is the "problem" because certainly I can't 
> Regards and thanks again

What this is doing is correct. The first repository is missing a 
provider for main's import of the ...runner.thread package, which is the 
first unsatisfied requirement you see. Then you add the second repo 
which has a provider for ...runner.thread, but that provider imports the 
...inter.runner package which cannot be satisfied in either repo1 or repo2.

So, you end up with two unsatisfied requirements on your second resolve 
attempt, one for the main's import of ...runner.thread and one for 
runner.thread's import of ...inter.runner, which is what you see above. 
Perhaps you are confused because you see two unsatisfied requirements 
here and you were expecting to see one. But two is correct since neither 
import from the two different bundles could be resolved.

On the third attempt you add both the repo2 and repo3 (although 
technically you don't need to add repo2 again, since you already added 
it). After that, everything can be satisfied, which is correct.

-> richard


>
>
> [1] http://felix.apache.org/site/downloads.cgi
>
>
> ----- Mensaje original -----
>> De: Richard S. Hall<he...@ungoverned.org>
>> Para: users@felix.apache.org
>> CC:
>> Enviado: sábado, 10 de marzo de 2012 20:32
>> Asunto: Re: OBR resolver knows about a requirement of a missing requirement
>>
>> I admit, I don't see it at first glance.
>>
>> If you want to email me privately a zip of your setup to easily
>> reproduce it, I could take a look.
>>
>> ->  richard
>>
>> On 3/10/12 17:37 , matias san martin wrote:
>>>    Hi Richard,Thank you for taking
>>>    the time to analyze my problem. I don't think it is a problem of
>>>    "logging", because if I print the number of missing requirements
>> in the
>>>    2nd iteration (where the question rises), it prints that 2 reqs are
>>>    missing (that would be Runner and InterRunner).
>>>
>>>    At the bottom of this mail you can find the content of the repository.xml
>> files I'm using [1].
>>>    Note that they are pasted all together but in my test they are separated in
>> 3 different files (corresponding to repo1,repo2,repo3). The names of the
>> packages and bundles are ones
>>>    I'm using in my test (in my original question they were simplified).
>>>
>>>    These files were created using the bindex tool.
>>>
>>>    I can share the bundles I'm using too (if they are needed). I'm
>> really curious about
>>>    this behavior and can't think of any explanation (note that I'm
>> just
>>>    starting using OSGi and Felix).
>>>
>>>    Many thanks again for taking the time to try to understand the problem
>> I'm presenting.
>>>    Regards
>>>    [1] Sorry I couldn't use a better way of posting the information (e.g.
>> using
>>>    pastebind or sth) because this mail was being detected as SPAM
>>>
>>>

[deleted repository.xml files]

>>>
>>>
>>>
>>>
>>>
>>>>    ________________________________
>>>>    De: Richard S. Hall<he...@ungoverned.org>
>>>>    Para: users@felix.apache.org
>>>>    Enviado: sábado, 10 de marzo de 2012 2:02
>>>>    Asunto: Re: OBR resolver knows about a requirement of a missing
>> requirement
>>>>    Perhaps  you are printing the messages in the wrong spot while
>> recursing...just a thought. Otherwise, it might be necessary to see your
>> repository.xml file.
>>>>
>>>>    "San Martín, Matías"<ma...@yahoo.com.ar>   wrote:
>>>>
>>>>>    Hi everybody,
>>>>>    first of all sorry about the odd mail subject, I will try to
>> explain
>>>>>    myself better.
>>>>>
>>>>>    The context of the problem:
>>>>>    =================
>>>>>
>>>>>    I have the following bundles:
>>>>>    Main
>>>>>       Depends on (packages): Console, InterConsole, Runner
>>>>>    Console:
>>>>>       Depends on: InterConsole
>>>>>       Exports (package): Console
>>>>>    InterConsole:
>>>>>       Exports: InterConsole
>>>>>    Runner:
>>>>>       Depends on: InterConsole, InterRunner
>>>>>       Exports: Runner
>>>>>    InterRunner:
>>>>>       Exports: InterRunner
>>>>>    //////////////////////////
>>>>>
>>>>>    I have the following OBR repositories:
>>>>>    Repo1: (contains) Main, Console, InterConsole
>>>>>    Repo2: Runner
>>>>>    Repo3: InterRunner
>>>>>    //////////////////////////
>>>>>
>>>>>    Then I have this (pseudo)code/logic:
>>>>>
>>>>>    1- Install Repo1 in OBR repository admin
>>>>>    2- discover resource Main
>>>>>    3- get a new resolver
>>>>>    4- try to deploy Main
>>>>>    5- If there are missing dependencies, print them, else go to pont 9
>>>>>    6- Find repository that contains missing dependencies
>>>>>    7- Install repository found
>>>>>    8- Go to point 3
>>>>>    9- Bundle deployed
>>>>>
>>>>>    The run output:
>>>>>    ==========
>>>>>
>>>>>    The execution of the logic just mentioned prints this:
>>>>>    Got new resolver
>>>>>    Missing dependency: InterRunner
>>>>>    Missing dependency: Runner
>>>>>    Installed Repository 3
>>>>>    Installed Repository 2
>>>>>    Got new resolver
>>>>>    Bundle deployed
>>>>>
>>>>>    The question/problem:
>>>>>    ===============
>>>>>    How is possible that the first resolver knows about the missing
>>>>>    dependency InterRunner if the Runner is not known yet???!!!
>>>>>
>>>>>    Any thoughts???
>>>>>
>>>>>    Thank you in advance for taking the time to read and give any
>> thought
>>>>>    to
>>>>>    my problem.
>>>>>    Regards
>>>>
>>>    ---------------------------------------------------------------------
>>>    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: OBR resolver knows about a requirement of a missing requirement

Posted by "Richard S. Hall" <he...@ungoverned.org>.
I admit, I don't see it at first glance.

If you want to email me privately a zip of your setup to easily 
reproduce it, I could take a look.

-> richard

On 3/10/12 17:37 , matias san martin wrote:
> Hi Richard,Thank you for taking
> the time to analyze my problem. I don't think it is a problem of
> "logging", because if I print the number of missing requirements in the
> 2nd iteration (where the question rises), it prints that 2 reqs are
> missing (that would be Runner and InterRunner).
>
> At the bottom of this mail you can find the content of the repository.xml files I'm using [1].
> Note that they are pasted all together but in my test they are separated in 3 different files (corresponding to repo1,repo2,repo3). The names of the packages and bundles are ones
> I'm using in my test (in my original question they were simplified).
>
> These files were created using the bindex tool.
>
> I can share the bundles I'm using too (if they are needed). I'm really curious about
> this behavior and can't think of any explanation (note that I'm just
> starting using OSGi and Felix).
>
> Many thanks again for taking the time to try to understand the problem I'm presenting.
> Regards
> [1] Sorry I couldn't use a better way of posting the information (e.g. using
> pastebind or sth) because this mail was being detected as SPAM
>
>
> /////////////////////////////////////// REPOSITORY FILES //////////////////////////////////////////////////////
> <?xml version='1.0' encoding='utf-8'?>
> <?xml-stylesheet type='text/xsl' href='http://www.osgi.org/www/obr2html.xsl';?>
>
> <repository lastmodified='20120310183715.359' name='repository_1'>
>
> <resource id='test.osgi.dynload.bundle.echoer.console/1.0.0'
> presentationname='Console'
> symbolicname='test.osgi.dynload.bundle.echoer.console'
> uri='test.osgi.dynload.bundle.echoer.console_1.0.0.jar'
> version='1.0.0'>
>      <size>
>        1859
>      </size>
>      <capability name='bundle'>
>        <p n='manifestversion' v='2'/>
>        <p n='presentationname' v='Console'/>
>        <p n='symbolicname' v='test.osgi.dynload.bundle.echoer.console'/>
>        <p n='version' t='version' v='1.0.0'/>
>      </capability>
>      <capability name='package'>
>        <p n='package' v='test.osgi.dynload.bundle.echoer.console'/>
>        <p n='uses' v='test.osgi.dynload.bundle.inter.echoer'/>
>        <p n='version' t='version'
> v='1.0.0'/>
>      </capability>
>      <require
> extend='false'
> filter='(&(package=test.osgi.dynload.bundle.inter.echoer)(version&gt;=1.0.0)(!(version&gt;=2.0.0)))'
> multiple='false' name='package' optional='false'>
>        Import package test.osgi.dynload.bundle.inter.echoer ;version=[1.0.0,2.0.0)
>      </require>
>      <require extend='false' filter='(|(ee=JavaSE-1.6))' multiple='false' name='ee' optional='false'>
>        Execution Environment (|(ee=JavaSE-1.6))
>      </require>
>    </resource>
>
> <resource id='test.osgi.dynload.bundle.interEch/1.0.0'
> presentationname='InterEch'
> symbolicname='test.osgi.dynload.bundle.interEch'
> uri='test.osgi.dynload.bundle.interEch_1.0.0.jar' version='1.0.0'>
>
> <size>
>        1968
>      </size>
>      <capability name='bundle'>
>        <p n='manifestversion' v='2'/>
>        <p n='presentationname' v='InterEch'/>
>        <p n='symbolicname' v='test.osgi.dynload.bundle.interEch'/>
>        <p n='version' t='version' v='1.0.0'/>
>      </capability>
>      <capability name='package'>
>        <p n='package' v='test.osgi.dynload.bundle.inter.echoer'/>
>        <p n='version' t='version' v='1.0.0'/>
>      </capability>
>      <require extend='false' filter='(|(ee=JavaSE-1.6))' multiple='false' name='ee' optional='false'>
>        Execution
> Environment (|(ee=JavaSE-1.6))
>      </require>
>    </resource>
>
> <resource id='test.osgi.dynload.bundle.main/1.0.0'
> presentationname='Main' symbolicname='test.osgi.dynload.bundle.main'
> uri='test.osgi.dynload.bundle.main_1.0.0.jar' version='1.0.0'>
>      <size>
>        1720
>      </size>
>      <capability name='bundle'>
>        <p n='manifestversion' v='2'/>
>        <p n='presentationname' v='Main'/>
>        <p n='symbolicname' v='test.osgi.dynload.bundle.main'/>
>        <p n='version' t='version' v='1.0.0'/>
>      </capability>
>      <require extend='false' filter='(&(package=org.osgi.framework)(version&gt;=1.3.0))' multiple='false'
> name='package' optional='false'>
>        Import package org.osgi.framework ;version=1.3.0
>      </require>
>
> <require extend='false'
> filter='(&(package=test.osgi.dynload.bundle.echoer.console)(version&gt;=1.0.0)(!(version&gt;=2.0.0)))'
> multiple='false' name='package' optional='false'>
>        Import package test.osgi.dynload.bundle.echoer.console ;version=[1.0.0,2.0.0)
>      </require>
>
> <require extend='false'
> filter='(&(package=test.osgi.dynload.bundle.inter.echoer)(version&gt;=1.0.0))'
> multiple='false' name='package' optional='false'>
>        Import package test.osgi.dynload.bundle.inter.echoer ;version=1.0.0
>      </require>
>
> <require extend='false'
>
> filter='(&(package=test.osgi.dynload.bundle.runner.thread)(version&gt;=1.0.0)(!(version&gt;=2.0.0)))'
> multiple='false' name='package' optional='false'>
>        Import package test.osgi.dynload.bundle.runner.thread ;version=[1.0.0,2.0.0)
>      </require>
>      <require extend='false' filter='(|(ee=JavaSE-1.6))' multiple='false' name='ee' optional='false'>
>        Execution Environment (|(ee=JavaSE-1.6))
>      </require>
>    </resource>
> </repository>
>
> <!------------------------------------------------------------------------------------->
> <repository lastmodified='20120309202958.415' name='repository2'>
>
> <resource id='test.osgi.dynload.bundle.runner.thread/1.0.0'
> presentationname='Runner Thread'
> symbolicname='test.osgi.dynload.bundle.runner.thread'
> uri='test.osgi.dynload.bundle.runner.thread_1.0.0.jar'
> version='1.0.0'>
>      <size>
>        3030
>      </size>
>      <capability name='bundle'>
>        <p n='manifestversion' v='2'/>
>        <p n='presentationname' v='Runner Thread'/>
>        <p n='symbolicname' v='test.osgi.dynload.bundle.runner.thread'/>
>        <p n='version' t='version' v='1.0.0'/>
>      </capability>
>      <capability name='package'>
>        <p n='package' v='test.osgi.dynload.bundle.runner.thread'/>
>        <p n='uses' v='test.osgi.dynload.bundle.inter.echoer,test.osgi.dynload.bundle.inter.runner'/>
>        <p n='version'
> t='version' v='1.0.0'/>
>      </capability>
>
> <require extend='false'
> filter='(&(package=test.osgi.dynload.bundle.inter.echoer)(version&gt;=1.0.0)(!(version&gt;=2.0.0)))'
> multiple='false' name='package' optional='false'>
>        Import package test.osgi.dynload.bundle.inter.echoer ;version=[1.0.0,2.0.0)
>      </require>
>
> <require extend='false'
> filter='(&(package=test.osgi.dynload.bundle.inter.runner)(version&gt;=1.0.0)(!(version&gt;=2.0.0)))'
> multiple='false' name='package' optional='false'>
>        Import package test.osgi.dynload.bundle.inter.runner ;version=[1.0.0,2.0.0)
>      </require>
>      <require extend='false' filter='(|(ee=JavaSE-1.6))' multiple='false' name='ee' optional='false'>
>
> Execution Environment (|(ee=JavaSE-1.6))
>      </require>
>    </resource>
> </repository>
>
> <!------------------------------------------------------------------------------------->
> <?xml version='1.0' encoding='utf-8'?>
> <?xml-stylesheet type='text/xsl' href='http://www.osgi.org/www/obr2html.xsl';?>
>
> <repository lastmodified='20120304150726.987' name='Repository3'>
>
> <resource id='test.osgi.dynload.bundle.interRun/1.0.0'
> presentationname='InterRun'
> symbolicname='test.osgi.dynload.bundle.interRun'
> uri='test.osgi.dynload.bundle.interRun_1.0.0.jar' version='1.0.0'>
>      <size>
>        1967
>      </size>
>      <capability name='bundle'>
>        <p n='manifestversion' v='2'/>
>        <p n='presentationname'
> v='InterRun'/>
>        <p n='symbolicname' v='test.osgi.dynload.bundle.interRun'/>
>        <p n='version' t='version' v='1.0.0'/>
>      </capability>
>      <capability name='package'>
>        <p n='package' v='test.osgi.dynload.bundle.inter.runner'/>
>        <p n='version' t='version' v='1.0.0'/>
>      </capability>
>      <require extend='false' filter='(|(ee=JavaSE-1.6))' multiple='false' name='ee' optional='false'>
>        Execution Environment (|(ee=JavaSE-1.6))
>      </require>
>
> </resource>
> </repository>
>
>
>
> ////////////////////////////////////////////////////////////////////////////////////////////////////////////
>
>
>
>
>
>
>> ________________________________
>> De: Richard S. Hall<he...@ungoverned.org>
>> Para: users@felix.apache.org
>> Enviado: sábado, 10 de marzo de 2012 2:02
>> Asunto: Re: OBR resolver knows about a requirement of a missing requirement
>>
>> Perhaps  you are printing the messages in the wrong spot while recursing...just a thought. Otherwise, it might be necessary to see your repository.xml file.
>>
>>
>> "San Martín, Matías"<ma...@yahoo.com.ar>  wrote:
>>
>>> Hi everybody,
>>> first of all sorry about the odd mail subject, I will try to explain
>>> myself better.
>>>
>>> The context of the problem:
>>> =================
>>>
>>> I have the following bundles:
>>> Main
>>>     Depends on (packages): Console, InterConsole, Runner
>>> Console:
>>>     Depends on: InterConsole
>>>     Exports (package): Console
>>> InterConsole:
>>>     Exports: InterConsole
>>> Runner:
>>>     Depends on: InterConsole, InterRunner
>>>     Exports: Runner
>>> InterRunner:
>>>     Exports: InterRunner
>>> //////////////////////////
>>>
>>> I have the following OBR repositories:
>>> Repo1: (contains) Main, Console, InterConsole
>>> Repo2: Runner
>>> Repo3: InterRunner
>>> //////////////////////////
>>>
>>> Then I have this (pseudo)code/logic:
>>>
>>> 1- Install Repo1 in OBR repository admin
>>> 2- discover resource Main
>>> 3- get a new resolver
>>> 4- try to deploy Main
>>> 5- If there are missing dependencies, print them, else go to pont 9
>>> 6- Find repository that contains missing dependencies
>>> 7- Install repository found
>>> 8- Go to point 3
>>> 9- Bundle deployed
>>>
>>> The run output:
>>> ==========
>>>
>>> The execution of the logic just mentioned prints this:
>>> Got new resolver
>>> Missing dependency: InterRunner
>>> Missing dependency: Runner
>>> Installed Repository 3
>>> Installed Repository 2
>>> Got new resolver
>>> Bundle deployed
>>>
>>> The question/problem:
>>> ===============
>>> How is possible that the first resolver knows about the missing
>>> dependency InterRunner if the Runner is not known yet???!!!
>>>
>>> Any thoughts???
>>>
>>> Thank you in advance for taking the time to read and give any thought
>>> to
>>> my problem.
>>> Regards
>>
>>
> ---------------------------------------------------------------------
> 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: OBR resolver knows about a requirement of a missing requirement

Posted by matias san martin <ma...@yahoo.com.ar>.
Hi Richard,Thank you for taking 
the time to analyze my problem. I don't think it is a problem of 
"logging", because if I print the number of missing requirements in the 
2nd iteration (where the question rises), it prints that 2 reqs are 
missing (that would be Runner and InterRunner).

At the bottom of this mail you can find the content of the repository.xml files I'm using [1]. 
Note that they are pasted all together but in my test they are separated in 3 different files (corresponding to repo1,repo2,repo3). The names of the packages and bundles are ones 
I'm using in my test (in my original question they were simplified).

These files were created using the bindex tool. 

I can share the bundles I'm using too (if they are needed). I'm really curious about 
this behavior and can't think of any explanation (note that I'm just 
starting using OSGi and Felix).

Many thanks again for taking the time to try to understand the problem I'm presenting.
Regards
[1] Sorry I couldn't use a better way of posting the information (e.g. using 
pastebind or sth) because this mail was being detected as SPAM


/////////////////////////////////////// REPOSITORY FILES //////////////////////////////////////////////////////
<?xml version='1.0' encoding='utf-8'?>
<?xml-stylesheet type='text/xsl' href='http://www.osgi.org/www/obr2html.xsl';?>

<repository lastmodified='20120310183715.359' name='repository_1'>

<resource id='test.osgi.dynload.bundle.echoer.console/1.0.0' 
presentationname='Console' 
symbolicname='test.osgi.dynload.bundle.echoer.console'
uri='test.osgi.dynload.bundle.echoer.console_1.0.0.jar' 
version='1.0.0'>
    <size>
      1859
    </size>
    <capability name='bundle'>
      <p n='manifestversion' v='2'/>
      <p n='presentationname' v='Console'/>
      <p n='symbolicname' v='test.osgi.dynload.bundle.echoer.console'/>
      <p n='version' t='version' v='1.0.0'/>
    </capability>
    <capability name='package'>
      <p n='package' v='test.osgi.dynload.bundle.echoer.console'/>
      <p n='uses' v='test.osgi.dynload.bundle.inter.echoer'/>
      <p n='version' t='version'
v='1.0.0'/>
    </capability>
    <require 
extend='false' 
filter='(&(package=test.osgi.dynload.bundle.inter.echoer)(version&gt;=1.0.0)(!(version&gt;=2.0.0)))'
multiple='false' name='package' optional='false'>
      Import package test.osgi.dynload.bundle.inter.echoer ;version=[1.0.0,2.0.0)
    </require>
    <require extend='false' filter='(|(ee=JavaSE-1.6))' multiple='false' name='ee' optional='false'>
      Execution Environment (|(ee=JavaSE-1.6))
    </require>
  </resource>

<resource id='test.osgi.dynload.bundle.interEch/1.0.0' 
presentationname='InterEch' 
symbolicname='test.osgi.dynload.bundle.interEch' 
uri='test.osgi.dynload.bundle.interEch_1.0.0.jar' version='1.0.0'>

<size>
      1968
    </size>
    <capability name='bundle'>
      <p n='manifestversion' v='2'/>
      <p n='presentationname' v='InterEch'/>
      <p n='symbolicname' v='test.osgi.dynload.bundle.interEch'/>
      <p n='version' t='version' v='1.0.0'/>
    </capability>
    <capability name='package'>
      <p n='package' v='test.osgi.dynload.bundle.inter.echoer'/>
      <p n='version' t='version' v='1.0.0'/>
    </capability>
    <require extend='false' filter='(|(ee=JavaSE-1.6))' multiple='false' name='ee' optional='false'>
      Execution
Environment (|(ee=JavaSE-1.6))
    </require>
  </resource>

<resource id='test.osgi.dynload.bundle.main/1.0.0' 
presentationname='Main' symbolicname='test.osgi.dynload.bundle.main' 
uri='test.osgi.dynload.bundle.main_1.0.0.jar' version='1.0.0'>
    <size>
      1720
    </size>
    <capability name='bundle'>
      <p n='manifestversion' v='2'/>
      <p n='presentationname' v='Main'/>
      <p n='symbolicname' v='test.osgi.dynload.bundle.main'/>
      <p n='version' t='version' v='1.0.0'/>
    </capability>
    <require extend='false' filter='(&(package=org.osgi.framework)(version&gt;=1.3.0))' multiple='false'
name='package' optional='false'>
      Import package org.osgi.framework ;version=1.3.0
    </require>

<require extend='false' 
filter='(&(package=test.osgi.dynload.bundle.echoer.console)(version&gt;=1.0.0)(!(version&gt;=2.0.0)))'
multiple='false' name='package' optional='false'>
      Import package test.osgi.dynload.bundle.echoer.console ;version=[1.0.0,2.0.0)
    </require>

<require extend='false' 
filter='(&(package=test.osgi.dynload.bundle.inter.echoer)(version&gt;=1.0.0))'
multiple='false' name='package' optional='false'>
      Import package test.osgi.dynload.bundle.inter.echoer ;version=1.0.0
    </require>

<require extend='false'

filter='(&(package=test.osgi.dynload.bundle.runner.thread)(version&gt;=1.0.0)(!(version&gt;=2.0.0)))'
multiple='false' name='package' optional='false'>
      Import package test.osgi.dynload.bundle.runner.thread ;version=[1.0.0,2.0.0)
    </require>
    <require extend='false' filter='(|(ee=JavaSE-1.6))' multiple='false' name='ee' optional='false'>
      Execution Environment (|(ee=JavaSE-1.6))
    </require>
  </resource>
</repository>

<!------------------------------------------------------------------------------------->
<repository lastmodified='20120309202958.415' name='repository2'>

<resource id='test.osgi.dynload.bundle.runner.thread/1.0.0' 
presentationname='Runner Thread' 
symbolicname='test.osgi.dynload.bundle.runner.thread'
uri='test.osgi.dynload.bundle.runner.thread_1.0.0.jar' 
version='1.0.0'>
    <size>
      3030
    </size>
    <capability name='bundle'>
      <p n='manifestversion' v='2'/>
      <p n='presentationname' v='Runner Thread'/>
      <p n='symbolicname' v='test.osgi.dynload.bundle.runner.thread'/>
      <p n='version' t='version' v='1.0.0'/>
    </capability>
    <capability name='package'>
      <p n='package' v='test.osgi.dynload.bundle.runner.thread'/>
      <p n='uses' v='test.osgi.dynload.bundle.inter.echoer,test.osgi.dynload.bundle.inter.runner'/>
      <p n='version'
t='version' v='1.0.0'/>
    </capability>

<require extend='false' 
filter='(&(package=test.osgi.dynload.bundle.inter.echoer)(version&gt;=1.0.0)(!(version&gt;=2.0.0)))'
multiple='false' name='package' optional='false'>
      Import package test.osgi.dynload.bundle.inter.echoer ;version=[1.0.0,2.0.0)
    </require>

<require extend='false' 
filter='(&(package=test.osgi.dynload.bundle.inter.runner)(version&gt;=1.0.0)(!(version&gt;=2.0.0)))'
multiple='false' name='package' optional='false'>
      Import package test.osgi.dynload.bundle.inter.runner ;version=[1.0.0,2.0.0)
    </require>
    <require extend='false' filter='(|(ee=JavaSE-1.6))' multiple='false' name='ee' optional='false'>

Execution Environment (|(ee=JavaSE-1.6))
    </require>
  </resource>
</repository>

<!------------------------------------------------------------------------------------->
<?xml version='1.0' encoding='utf-8'?>
<?xml-stylesheet type='text/xsl' href='http://www.osgi.org/www/obr2html.xsl';?>

<repository lastmodified='20120304150726.987' name='Repository3'>

<resource id='test.osgi.dynload.bundle.interRun/1.0.0' 
presentationname='InterRun' 
symbolicname='test.osgi.dynload.bundle.interRun' 
uri='test.osgi.dynload.bundle.interRun_1.0.0.jar' version='1.0.0'>
    <size>
      1967
    </size>
    <capability name='bundle'>
      <p n='manifestversion' v='2'/>
      <p n='presentationname'
v='InterRun'/>
      <p n='symbolicname' v='test.osgi.dynload.bundle.interRun'/>
      <p n='version' t='version' v='1.0.0'/>
    </capability>
    <capability name='package'>
      <p n='package' v='test.osgi.dynload.bundle.inter.runner'/>
      <p n='version' t='version' v='1.0.0'/>
    </capability>
    <require extend='false' filter='(|(ee=JavaSE-1.6))' multiple='false' name='ee' optional='false'>
      Execution Environment (|(ee=JavaSE-1.6))
    </require>

</resource>
</repository>



////////////////////////////////////////////////////////////////////////////////////////////////////////////






>________________________________
> De: Richard S. Hall <he...@ungoverned.org>
>Para: users@felix.apache.org 
>Enviado: sábado, 10 de marzo de 2012 2:02
>Asunto: Re: OBR resolver knows about a requirement of a missing requirement
> 
>Perhaps  you are printing the messages in the wrong spot while recursing...just a thought. Otherwise, it might be necessary to see your repository.xml file.
>
>
>"San Martín, Matías" <ma...@yahoo.com.ar> wrote:
>
>>Hi everybody, 
>>first of all sorry about the odd mail subject, I will try to explain
>>myself better.
>>
>>The context of the problem:
>>=================
>>
>>I have the following bundles:
>>Main 
>>   Depends on (packages): Console, InterConsole, Runner
>>Console: 
>>   Depends on: InterConsole
>>   Exports (package): Console
>>InterConsole:
>>   Exports: InterConsole
>>Runner:
>>   Depends on: InterConsole, InterRunner
>>   Exports: Runner
>>InterRunner:
>>   Exports: InterRunner
>>//////////////////////////
>>
>>I have the following OBR repositories:
>>Repo1: (contains) Main, Console, InterConsole
>>Repo2: Runner
>>Repo3: InterRunner
>>//////////////////////////
>>
>>Then I have this (pseudo)code/logic:
>>
>>1- Install Repo1 in OBR repository admin
>>2- discover resource Main
>>3- get a new resolver
>>4- try to deploy Main
>>5- If there are missing dependencies, print them, else go to pont 9
>>6- Find repository that contains missing dependencies
>>7- Install repository found
>>8- Go to point 3
>>9- Bundle deployed
>>
>>The run output:
>>==========
>>
>>The execution of the logic just mentioned prints this:
>>Got new resolver
>>Missing dependency: InterRunner
>>Missing dependency: Runner
>>Installed Repository 3
>>Installed Repository 2
>>Got new resolver
>>Bundle deployed
>>
>>The question/problem:
>>===============
>>How is possible that the first resolver knows about the missing
>>dependency InterRunner if the Runner is not known yet???!!!
>>
>>Any thoughts???
>>
>>Thank you in advance for taking the time to read and give any thought
>>to
>>my problem.
>>Regards
>
>
>                              

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


Re: OBR resolver knows about a requirement of a missing requirement

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Perhaps  you are printing the messages in the wrong spot while recursing...just a thought. Otherwise, it might be necessary to see your repository.xml file.


"San Martín, Matías" <ma...@yahoo.com.ar> wrote:

>Hi everybody, 
>first of all sorry about the odd mail subject, I will try to explain
>myself better.
>
>The context of the problem:
>=================
>
>I have the following bundles:
>Main 
>   Depends on (packages): Console, InterConsole, Runner
>Console: 
>   Depends on: InterConsole
>   Exports (package): Console
>InterConsole:
>   Exports: InterConsole
>Runner:
>   Depends on: InterConsole, InterRunner
>   Exports: Runner
>InterRunner:
>   Exports: InterRunner
>//////////////////////////
>
>I have the following OBR repositories:
>Repo1: (contains) Main, Console, InterConsole
>Repo2: Runner
>Repo3: InterRunner
>//////////////////////////
>
>Then I have this (pseudo)code/logic:
>
>1- Install Repo1 in OBR repository admin
>2- discover resource Main
>3- get a new resolver
>4- try to deploy Main
>5- If there are missing dependencies, print them, else go to pont 9
>6- Find repository that contains missing dependencies
>7- Install repository found
>8- Go to point 3
>9- Bundle deployed
>
>The run output:
>==========
>
>The execution of the logic just mentioned prints this:
>Got new resolver
>Missing dependency: InterRunner
>Missing dependency: Runner
>Installed Repository 3
>Installed Repository 2
>Got new resolver
>Bundle deployed
>
>The question/problem:
>===============
>How is possible that the first resolver knows about the missing
>dependency InterRunner if the Runner is not known yet???!!!
>
>Any thoughts???
>
>Thank you in advance for taking the time to read and give any thought
>to
>my problem.
>Regards