You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Eric Yung <ER...@jspectrum.com> on 2011/05/21 20:39:06 UTC

problem for dependency to google guice fragment bundles due to deployment order

Hi,

I have tried to use the Google Guice 3.0 bundles in Felix 3.2.1, the bundles includes one main bundle and several fragment bundles. But I found a strange behavior when starting the Felix framework when the Guice bundles and my bundle deployed in the /bundle directory and the my bundle is deployed before the Guice bundles.

The framework may complain about the following error but it does NOT happen every time (sometimes there is NO error and my bundle can be deployed and started).

Candidate permutation failed due to a conflict between imports; will try another if possible. (org.apache.felix.framework.resolver.ResolveException: Uses constraint violation. Unable to resolve module com.abc.bundle1 [5.0] because it is exposed to package 'com.google.inject.name' from modules com.google.inject [72.0] and com.google.inject [72.0] via two dependency chains.
Chain 1:
  com.abc.bundle1 [5.0]
    import: (package=com.google.inject.name)
     |
    export: package=com.google.inject.name
  com.google.inject [72.0]

Chain 2:
  com.abc.bundle1 [5.0]
    import: (package=com.abc.package)
     |
    export: package=com.abc.package; uses:=com.google.inject.name
  com.abc.bundle2 [11.0]
    import: (package=com.google.inject.name)
     |
    export: package=com.google.inject.name
  com.google.inject [72.0])

  at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3524)
  at org.apache.felix.framework.Felix.startBundle(Felix.java:1750)
  at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1179)
  at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
  at java.lang.Thread.run(Thread.java:680)


If I make the Guice bundles be deployed before my bundle, there is NO error (I have tried more than 10 times and I think it can solve my problem).


Eric

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


Re: problem for dependency to google guice fragment bundles due to deployment order

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Ok, I'll try to check it out.

-> richard

On 5/22/11 10:16, Eric Yung wrote:
> Hi Richard,
>
> Here are the steps to reproduce the error and I run the Felix framework 3.2.1 on my Pentium D CPU 2.80GHz Linux 2.6 server running Gentoo Linux and I had tried on my Macbook Pro and the result is the same.
>
> create a module 'com.abc.bundle2' which import package 'com.google.inject.name' from the Guice 3.0 bundles and export package 'com.abc.package;use=com.google.inject.name'
> create another module 'com.abc.bundle1' which import package 'com.google.inject.name' from the Guice 3.0 bundles and package 'com.abc.package' from module 'com.abc.bundle2'
> the file name for module 'com.abc.bundle1' is com.abc.bundle1.jar and the file name for module 'com.abc.bundle2' is com.abc.bundle2.jar
> put the above modules into the bundle sub-directory of the Felix framework installation
> put the Guice 3.0 modules into the same sub-directory
> start Felix 3.2.1
> check the output - on my Macbook Pro and the Linux server, there is 50% chances the error will happen
>
> Here is the steps to avoid the error.
>
> rename the file name of the Guice 3.0 modules from guice-....jar to _guice-....jar
> after Guice 3.0 modules renaming, the Guice 3.0 module will be loaded into the system earlier than my modules 'com.abc.bundle1' and 'com.abc.bundle2'
> start Felix 3.2.1 and there is NO 'conflict of imports' error
>
>
> Eric
>
>
>
> On 22 May 2011, at 9:59 PM, Richard S. Hall wrote:
>
>> Could you give me some detailed steps to reproduce the error you are seeing?
>>
>> ->  richard
>>
>> On 5/22/11 1:10, Eric Yung wrote:
>>> Hi Richard,
>>>
>>> My bundle did NOT work at all after the complain.
>>>
>>> And I have modified the 3.2.1 source to check the detail. It seems the module com.google.inject [72.0] in the error refers to two different Module implementation - one is org.apache.felix.framework.ModuleImpl and another is org.apache.felix.framework.resolver.HostModule. And the checking to see if they are compatible returns false.
>>>
>>>
>>> Eric
>>>
>>>
>>>
>>> On 22 May 2011, at 2:55 AM, Richard S. Hall wrote:
>>>
>>>> Does it just complain, but still work in the end or does it fail to work at all?
>>>>
>>>> If it just complains, but still works then it likely is just informing you of the issue. This can happen depending on installation order because installation order is taken into account when determining priority of candidates (older bundles have higher priority).
>>>>
>>>> So, in short, if it is working even when it complains, then there is nothing to worry about.
>>>>
>>>> ->   richard
>>>>
>>>> On 5/21/11 14:39, Eric Yung wrote:
>>>>> Hi,
>>>>>
>>>>> I have tried to use the Google Guice 3.0 bundles in Felix 3.2.1, the bundles includes one main bundle and several fragment bundles. But I found a strange behavior when starting the Felix framework when the Guice bundles and my bundle deployed in the /bundle directory and the my bundle is deployed before the Guice bundles.
>>>>>
>>>>> The framework may complain about the following error but it does NOT happen every time (sometimes there is NO error and my bundle can be deployed and started).
>>>>>
>>>>> Candidate permutation failed due to a conflict between imports; will try another if possible. (org.apache.felix.framework.resolver.ResolveException: Uses constraint violation. Unable to resolve module com.abc.bundle1 [5.0] because it is exposed to package 'com.google.inject.name' from modules com.google.inject [72.0] and com.google.inject [72.0] via two dependency chains.
>>>>> Chain 1:
>>>>>    com.abc.bundle1 [5.0]
>>>>>      import: (package=com.google.inject.name)
>>>>>       |
>>>>>      export: package=com.google.inject.name
>>>>>    com.google.inject [72.0]
>>>>>
>>>>> Chain 2:
>>>>>    com.abc.bundle1 [5.0]
>>>>>      import: (package=com.abc.package)
>>>>>       |
>>>>>      export: package=com.abc.package; uses:=com.google.inject.name
>>>>>    com.abc.bundle2 [11.0]
>>>>>      import: (package=com.google.inject.name)
>>>>>       |
>>>>>      export: package=com.google.inject.name
>>>>>    com.google.inject [72.0])
>>>>>
>>>>>    at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3524)
>>>>>    at org.apache.felix.framework.Felix.startBundle(Felix.java:1750)
>>>>>    at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1179)
>>>>>    at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>    at java.lang.Thread.run(Thread.java:680)
>>>>>
>>>>>
>>>>> If I make the Guice bundles be deployed before my bundle, there is NO error (I have tried more than 10 times and I think it can solve my problem).
>>>>>
>>>>>
>>>>> Eric
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>

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


Re: problem for dependency to google guice fragment bundles due to deployment order

Posted by Eric Yung <er...@jspectrum.com>.
Hi Richard,

Here are the steps to reproduce the error and I run the Felix framework 3.2.1 on my Pentium D CPU 2.80GHz Linux 2.6 server running Gentoo Linux and I had tried on my Macbook Pro and the result is the same.

create a module 'com.abc.bundle2' which import package 'com.google.inject.name' from the Guice 3.0 bundles and export package 'com.abc.package;use=com.google.inject.name'
create another module 'com.abc.bundle1' which import package 'com.google.inject.name' from the Guice 3.0 bundles and package 'com.abc.package' from module 'com.abc.bundle2'
the file name for module 'com.abc.bundle1' is com.abc.bundle1.jar and the file name for module 'com.abc.bundle2' is com.abc.bundle2.jar
put the above modules into the bundle sub-directory of the Felix framework installation
put the Guice 3.0 modules into the same sub-directory
start Felix 3.2.1
check the output - on my Macbook Pro and the Linux server, there is 50% chances the error will happen

Here is the steps to avoid the error.

rename the file name of the Guice 3.0 modules from guice-....jar to _guice-....jar
after Guice 3.0 modules renaming, the Guice 3.0 module will be loaded into the system earlier than my modules 'com.abc.bundle1' and 'com.abc.bundle2'
start Felix 3.2.1 and there is NO 'conflict of imports' error


Eric



On 22 May 2011, at 9:59 PM, Richard S. Hall wrote:

> Could you give me some detailed steps to reproduce the error you are seeing?
> 
> -> richard
> 
> On 5/22/11 1:10, Eric Yung wrote:
>> Hi Richard,
>> 
>> My bundle did NOT work at all after the complain.
>> 
>> And I have modified the 3.2.1 source to check the detail. It seems the module com.google.inject [72.0] in the error refers to two different Module implementation - one is org.apache.felix.framework.ModuleImpl and another is org.apache.felix.framework.resolver.HostModule. And the checking to see if they are compatible returns false.
>> 
>> 
>> Eric
>> 
>> 
>> 
>> On 22 May 2011, at 2:55 AM, Richard S. Hall wrote:
>> 
>>> Does it just complain, but still work in the end or does it fail to work at all?
>>> 
>>> If it just complains, but still works then it likely is just informing you of the issue. This can happen depending on installation order because installation order is taken into account when determining priority of candidates (older bundles have higher priority).
>>> 
>>> So, in short, if it is working even when it complains, then there is nothing to worry about.
>>> 
>>> ->  richard
>>> 
>>> On 5/21/11 14:39, Eric Yung wrote:
>>>> Hi,
>>>> 
>>>> I have tried to use the Google Guice 3.0 bundles in Felix 3.2.1, the bundles includes one main bundle and several fragment bundles. But I found a strange behavior when starting the Felix framework when the Guice bundles and my bundle deployed in the /bundle directory and the my bundle is deployed before the Guice bundles.
>>>> 
>>>> The framework may complain about the following error but it does NOT happen every time (sometimes there is NO error and my bundle can be deployed and started).
>>>> 
>>>> Candidate permutation failed due to a conflict between imports; will try another if possible. (org.apache.felix.framework.resolver.ResolveException: Uses constraint violation. Unable to resolve module com.abc.bundle1 [5.0] because it is exposed to package 'com.google.inject.name' from modules com.google.inject [72.0] and com.google.inject [72.0] via two dependency chains.
>>>> Chain 1:
>>>>   com.abc.bundle1 [5.0]
>>>>     import: (package=com.google.inject.name)
>>>>      |
>>>>     export: package=com.google.inject.name
>>>>   com.google.inject [72.0]
>>>> 
>>>> Chain 2:
>>>>   com.abc.bundle1 [5.0]
>>>>     import: (package=com.abc.package)
>>>>      |
>>>>     export: package=com.abc.package; uses:=com.google.inject.name
>>>>   com.abc.bundle2 [11.0]
>>>>     import: (package=com.google.inject.name)
>>>>      |
>>>>     export: package=com.google.inject.name
>>>>   com.google.inject [72.0])
>>>> 
>>>>   at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3524)
>>>>   at org.apache.felix.framework.Felix.startBundle(Felix.java:1750)
>>>>   at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1179)
>>>>   at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>   at java.lang.Thread.run(Thread.java:680)
>>>> 
>>>> 
>>>> If I make the Guice bundles be deployed before my bundle, there is NO error (I have tried more than 10 times and I think it can solve my problem).
>>>> 
>>>> 
>>>> Eric
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org


Re: problem for dependency to google guice fragment bundles due to deployment order

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Could you give me some detailed steps to reproduce the error you are seeing?

-> richard

On 5/22/11 1:10, Eric Yung wrote:
> Hi Richard,
>
> My bundle did NOT work at all after the complain.
>
> And I have modified the 3.2.1 source to check the detail. It seems the module com.google.inject [72.0] in the error refers to two different Module implementation - one is org.apache.felix.framework.ModuleImpl and another is org.apache.felix.framework.resolver.HostModule. And the checking to see if they are compatible returns false.
>
>
> Eric
>
>
>
> On 22 May 2011, at 2:55 AM, Richard S. Hall wrote:
>
>> Does it just complain, but still work in the end or does it fail to work at all?
>>
>> If it just complains, but still works then it likely is just informing you of the issue. This can happen depending on installation order because installation order is taken into account when determining priority of candidates (older bundles have higher priority).
>>
>> So, in short, if it is working even when it complains, then there is nothing to worry about.
>>
>> ->  richard
>>
>> On 5/21/11 14:39, Eric Yung wrote:
>>> Hi,
>>>
>>> I have tried to use the Google Guice 3.0 bundles in Felix 3.2.1, the bundles includes one main bundle and several fragment bundles. But I found a strange behavior when starting the Felix framework when the Guice bundles and my bundle deployed in the /bundle directory and the my bundle is deployed before the Guice bundles.
>>>
>>> The framework may complain about the following error but it does NOT happen every time (sometimes there is NO error and my bundle can be deployed and started).
>>>
>>> Candidate permutation failed due to a conflict between imports; will try another if possible. (org.apache.felix.framework.resolver.ResolveException: Uses constraint violation. Unable to resolve module com.abc.bundle1 [5.0] because it is exposed to package 'com.google.inject.name' from modules com.google.inject [72.0] and com.google.inject [72.0] via two dependency chains.
>>> Chain 1:
>>>    com.abc.bundle1 [5.0]
>>>      import: (package=com.google.inject.name)
>>>       |
>>>      export: package=com.google.inject.name
>>>    com.google.inject [72.0]
>>>
>>> Chain 2:
>>>    com.abc.bundle1 [5.0]
>>>      import: (package=com.abc.package)
>>>       |
>>>      export: package=com.abc.package; uses:=com.google.inject.name
>>>    com.abc.bundle2 [11.0]
>>>      import: (package=com.google.inject.name)
>>>       |
>>>      export: package=com.google.inject.name
>>>    com.google.inject [72.0])
>>>
>>>    at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3524)
>>>    at org.apache.felix.framework.Felix.startBundle(Felix.java:1750)
>>>    at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1179)
>>>    at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>    at java.lang.Thread.run(Thread.java:680)
>>>
>>>
>>> If I make the Guice bundles be deployed before my bundle, there is NO error (I have tried more than 10 times and I think it can solve my problem).
>>>
>>>
>>> Eric
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

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


Re: problem for dependency to google guice fragment bundles due to deployment order

Posted by Eric Yung <er...@jspectrum.com>.
Hi Richard,

My bundle did NOT work at all after the complain.

And I have modified the 3.2.1 source to check the detail. It seems the module com.google.inject [72.0] in the error refers to two different Module implementation - one is org.apache.felix.framework.ModuleImpl and another is org.apache.felix.framework.resolver.HostModule. And the checking to see if they are compatible returns false.


Eric



On 22 May 2011, at 2:55 AM, Richard S. Hall wrote:

> Does it just complain, but still work in the end or does it fail to work at all?
> 
> If it just complains, but still works then it likely is just informing you of the issue. This can happen depending on installation order because installation order is taken into account when determining priority of candidates (older bundles have higher priority).
> 
> So, in short, if it is working even when it complains, then there is nothing to worry about.
> 
> -> richard
> 
> On 5/21/11 14:39, Eric Yung wrote:
>> Hi,
>> 
>> I have tried to use the Google Guice 3.0 bundles in Felix 3.2.1, the bundles includes one main bundle and several fragment bundles. But I found a strange behavior when starting the Felix framework when the Guice bundles and my bundle deployed in the /bundle directory and the my bundle is deployed before the Guice bundles.
>> 
>> The framework may complain about the following error but it does NOT happen every time (sometimes there is NO error and my bundle can be deployed and started).
>> 
>> Candidate permutation failed due to a conflict between imports; will try another if possible. (org.apache.felix.framework.resolver.ResolveException: Uses constraint violation. Unable to resolve module com.abc.bundle1 [5.0] because it is exposed to package 'com.google.inject.name' from modules com.google.inject [72.0] and com.google.inject [72.0] via two dependency chains.
>> Chain 1:
>>   com.abc.bundle1 [5.0]
>>     import: (package=com.google.inject.name)
>>      |
>>     export: package=com.google.inject.name
>>   com.google.inject [72.0]
>> 
>> Chain 2:
>>   com.abc.bundle1 [5.0]
>>     import: (package=com.abc.package)
>>      |
>>     export: package=com.abc.package; uses:=com.google.inject.name
>>   com.abc.bundle2 [11.0]
>>     import: (package=com.google.inject.name)
>>      |
>>     export: package=com.google.inject.name
>>   com.google.inject [72.0])
>> 
>>   at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3524)
>>   at org.apache.felix.framework.Felix.startBundle(Felix.java:1750)
>>   at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1179)
>>   at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>   at java.lang.Thread.run(Thread.java:680)
>> 
>> 
>> If I make the Guice bundles be deployed before my bundle, there is NO error (I have tried more than 10 times and I think it can solve my problem).
>> 
>> 
>> Eric
>> 
>> ---------------------------------------------------------------------
>> 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: problem for dependency to google guice fragment bundles due to deployment order

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Does it just complain, but still work in the end or does it fail to work 
at all?

If it just complains, but still works then it likely is just informing 
you of the issue. This can happen depending on installation order 
because installation order is taken into account when determining 
priority of candidates (older bundles have higher priority).

So, in short, if it is working even when it complains, then there is 
nothing to worry about.

-> richard

On 5/21/11 14:39, Eric Yung wrote:
> Hi,
>
> I have tried to use the Google Guice 3.0 bundles in Felix 3.2.1, the bundles includes one main bundle and several fragment bundles. But I found a strange behavior when starting the Felix framework when the Guice bundles and my bundle deployed in the /bundle directory and the my bundle is deployed before the Guice bundles.
>
> The framework may complain about the following error but it does NOT happen every time (sometimes there is NO error and my bundle can be deployed and started).
>
> Candidate permutation failed due to a conflict between imports; will try another if possible. (org.apache.felix.framework.resolver.ResolveException: Uses constraint violation. Unable to resolve module com.abc.bundle1 [5.0] because it is exposed to package 'com.google.inject.name' from modules com.google.inject [72.0] and com.google.inject [72.0] via two dependency chains.
> Chain 1:
>    com.abc.bundle1 [5.0]
>      import: (package=com.google.inject.name)
>       |
>      export: package=com.google.inject.name
>    com.google.inject [72.0]
>
> Chain 2:
>    com.abc.bundle1 [5.0]
>      import: (package=com.abc.package)
>       |
>      export: package=com.abc.package; uses:=com.google.inject.name
>    com.abc.bundle2 [11.0]
>      import: (package=com.google.inject.name)
>       |
>      export: package=com.google.inject.name
>    com.google.inject [72.0])
>
>    at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3524)
>    at org.apache.felix.framework.Felix.startBundle(Felix.java:1750)
>    at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1179)
>    at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>    at java.lang.Thread.run(Thread.java:680)
>
>
> If I make the Guice bundles be deployed before my bundle, there is NO error (I have tried more than 10 times and I think it can solve my problem).
>
>
> Eric
>
> ---------------------------------------------------------------------
> 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