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<[email protected]>
Para: [email protected]
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<[email protected]>
   Para: [email protected]
   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"<[email protected]>   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: [email protected]
   For additional commands, e-mail: [email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to