You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Remo Liechti <re...@swisslog.com> on 2016/08/10 07:32:59 UTC

Cannot use configuration pid ... for bundle XX because it belongs to bundle YY

Hi guys

During starting of bundles I get the following message:
<Aug 10, 2016 8:10:42 AM CEST> <Error> <OSGiForApps> <BEA-000000> <org.apache.felix.scr:92:Cannot use configuration pid=com.kuka.configuration.manager for bundle 17 because it belongs to bundle 7>

What does this actually mean? I have not found good information with uncle sams google.
What I do, is the following:
- Wrap an osgi application into a j2ee web application (war file)
- Using Felix on Weblogic: https://docs.oracle.com/middleware/1212/wls/WLPRG/osgi.htm
- My main bundle activator is called, using a servlet I start all other bundles manually


@Resource(lookup = "java:app/osgi/Bundle")
Bundle bundle;

BundleContext bc = bundle.getBundleContext();
for (Bundle b : bc.getBundles()) {
[....]
b.start();
[...]
}

Thanks,
Remo


This message may contain legally privileged or confidential information and is therefore addressed to the named persons only. The recipient should inform the sender and delete this message, if he/she is not named as addressee. The sender disclaims any and all liability for the integrity and punctuality of this message. The sender has activated an automatic virus scanning, but does not guarantee the virus free transmission of this message.

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


Re: Cannot use configuration pid ... for bundle XX because it belongs to bundle YY

Posted by Carsten Ziegeler <cz...@apache.org>.
> Carsten, are you sure about null and not the literal string "?"

Hi,

both work - if you have a configuration admin supporting multi locations
(the "?"). But as that is in there for some time, you probably have it.
null works in any case and does not change the location at all - that's
why I prefer it.

From the javadocs of getConfiguration:
         *If the
	 * location parameter is {@code null}, it will be set when a Managed
Service
	 * with the corresponding PID is registered for the first time.

Carsten

> 
> - Ray
> 
> On Wed, Aug 10, 2016 at 9:57 AM, Carsten Ziegeler <cz...@apache.org>
> wrote:
> 
>>> Did not find any annotation in those components, they actually get
>> configured using the ConfigurationAdmin.
>>>
>>> Error:
>>> <org.apache.felix.scr:86:Cannot use configuration pid=com.kuka.authorizationService.component
>> for bundle 7 because it belongs to bundle 77>
>>>
>>> OSGI-LIB\*.xml:
>>> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
>> activate="activate" configuration-policy="require" deactivate="deactivate"
>> immediate="true" name="com.kuka.authorizationService.component">
>>>    <implementation class="com.....AuthorizationServiceComponent"/>
>>>    <service>
>>>       <provide interface="com....IAuthorizationOsgiService"/>
>>>    </service>
>>>    <reference
>>>       bind="setServiceRegistry"
>>>       cardinality="1..1"
>>>       interface="com....IServiceRegistry"
>>>       name="IServiceRegistry"
>>>       configuration-policy="require"
>>>       policy="static"/>
>>> </scr:component>
>>>
>>> The component itself that has no annotations at all:
>>> [...]
>>> import com.....IServiceRegistry;
>>>
>>> /**
>>>  * The OSGI component for the {@link AuthorizationService}.
>>>  */
>>> public class AuthorizationServiceComponent implements
>> IAuthorizationOsgiService
>>> [...]
>>>
>>> The main bundle activator does the following regarding this component:
>>> Dictionary<String, Object> properties = new Hashtable<String, Object>();
>>> properties.put("userRolesFile", "someFileSystemPath");
>>> properties.put("userCredentialsFile", "someFileSystemPath");
>>> configAdmin.getConfiguration("com.kuka.authorizationService.
>> component").update(properties);
>>
>> This is exactly your problem :) With this you bind the configuration to
>> the bundle executing this code and then DS can't use it anymore. Change
>> it to use the two argument getConfiguration method and pass null as the
>> second argument (location).
>>
>> Regards
>> Carsten
>>>
>>> Interesting that all bundles that are configured like this end in such
>> an error.
>>> The application I try to wrap was built in equinox and starts there
>> without issues.
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Benson Margulies [mailto:benson@basistech.com]
>>> Sent: Mittwoch, 10. August 2016 12:46
>>> To: users@felix.apache.org
>>> Subject: Re: Cannot use configuration pid ... for bundle XX because it
>> belongs to bundle YY
>>>
>>> In my experience, it means that you have annotated two different classes
>> with @Component and specified the same configurationPid. You can't do that;
>> if you need to share a configuration between DS components, you have to
>> inject the ConfigurationAdmin service instead of using the @Component
>> annotation.
>>>
>>> On Wed, Aug 10, 2016 at 3:32 AM, Remo Liechti <remo.liechti@swisslog.com
>>>
>>> wrote:
>>>
>>>> Hi guys
>>>>
>>>> During starting of bundles I get the following message:
>>>> <Aug 10, 2016 8:10:42 AM CEST> <Error> <OSGiForApps> <BEA-000000>
>>>> <org.apache.felix.scr:92:Cannot use configuration
>>>> pid=com.kuka.configuration.manager for bundle 17 because it belongs to
>>>> bundle 7>
>>>>
>>>> What does this actually mean? I have not found good information with
>>>> uncle sams google.
>>>> What I do, is the following:
>>>> - Wrap an osgi application into a j2ee web application (war file)
>>>> - Using Felix on Weblogic: https://docs.oracle.com/
>>>> middleware/1212/wls/WLPRG/osgi.htm
>>>> - My main bundle activator is called, using a servlet I start all
>>>> other bundles manually
>>>>
>>>>
>>>> @Resource(lookup = "java:app/osgi/Bundle") Bundle bundle;
>>>>
>>>> BundleContext bc = bundle.getBundleContext(); for (Bundle b :
>>>> bc.getBundles()) { [....] b.start(); [...] }
>>>>
>>>> Thanks,
>>>> Remo
>>>>
>>>>
>>>> This message may contain legally privileged or confidential
>>>> information and is therefore addressed to the named persons only. The
>>>> recipient should inform the sender and delete this message, if he/she
>>>> is not named as addressee. The sender disclaims any and all liability
>>>> for the integrity and punctuality of this message. The sender has
>>>> activated an automatic virus scanning, but does not guarantee the
>>>> virus free transmission of this message.
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>>
>>> This message may contain legally privileged or confidential information
>> and is therefore addressed to the named persons only. The recipient should
>> inform the sender and delete this message, if he/she is not named as
>> addressee. The sender disclaims any and all liability for the integrity and
>> punctuality of this message. The sender has activated an automatic virus
>> scanning, but does not guarantee the virus free transmission of this
>> message.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>
>>
>>
>>
>> --
>> Carsten Ziegeler
>> Adobe Research Switzerland
>> cziegeler@apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
> 
> 


 

-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org


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


Re: Cannot use configuration pid ... for bundle XX because it belongs to bundle YY

Posted by David Jencks <da...@yahoo.com.INVALID>.
null works, ds < 2.0.4 will (except for unusual situations not likely here) set the bundle location to the using bundle, ds >-2.0.4 will leave it null.  This will “claim” the configuration for the using bundle.

? works with a R5+ config admin and multiple bundles can use the configuration.

david jencks

> On Aug 10, 2016, at 7:36 AM, Raymond Auge <ra...@liferay.com> wrote:
> 
> Carsten, are you sure about null and not the literal string "?"
> 
> - Ray
> 
> On Wed, Aug 10, 2016 at 9:57 AM, Carsten Ziegeler <cz...@apache.org>
> wrote:
> 
>>> Did not find any annotation in those components, they actually get
>> configured using the ConfigurationAdmin.
>>> 
>>> Error:
>>> <org.apache.felix.scr:86:Cannot use configuration pid=com.kuka.authorizationService.component
>> for bundle 7 because it belongs to bundle 77>
>>> 
>>> OSGI-LIB\*.xml:
>>> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
>> activate="activate" configuration-policy="require" deactivate="deactivate"
>> immediate="true" name="com.kuka.authorizationService.component">
>>>   <implementation class="com.....AuthorizationServiceComponent"/>
>>>   <service>
>>>      <provide interface="com....IAuthorizationOsgiService"/>
>>>   </service>
>>>   <reference
>>>      bind="setServiceRegistry"
>>>      cardinality="1..1"
>>>      interface="com....IServiceRegistry"
>>>      name="IServiceRegistry"
>>>      configuration-policy="require"
>>>      policy="static"/>
>>> </scr:component>
>>> 
>>> The component itself that has no annotations at all:
>>> [...]
>>> import com.....IServiceRegistry;
>>> 
>>> /**
>>> * The OSGI component for the {@link AuthorizationService}.
>>> */
>>> public class AuthorizationServiceComponent implements
>> IAuthorizationOsgiService
>>> [...]
>>> 
>>> The main bundle activator does the following regarding this component:
>>> Dictionary<String, Object> properties = new Hashtable<String, Object>();
>>> properties.put("userRolesFile", "someFileSystemPath");
>>> properties.put("userCredentialsFile", "someFileSystemPath");
>>> configAdmin.getConfiguration("com.kuka.authorizationService.
>> component").update(properties);
>> 
>> This is exactly your problem :) With this you bind the configuration to
>> the bundle executing this code and then DS can't use it anymore. Change
>> it to use the two argument getConfiguration method and pass null as the
>> second argument (location).
>> 
>> Regards
>> Carsten
>>> 
>>> Interesting that all bundles that are configured like this end in such
>> an error.
>>> The application I try to wrap was built in equinox and starts there
>> without issues.
>>> 
>>> 
>>> 
>>> -----Original Message-----
>>> From: Benson Margulies [mailto:benson@basistech.com]
>>> Sent: Mittwoch, 10. August 2016 12:46
>>> To: users@felix.apache.org
>>> Subject: Re: Cannot use configuration pid ... for bundle XX because it
>> belongs to bundle YY
>>> 
>>> In my experience, it means that you have annotated two different classes
>> with @Component and specified the same configurationPid. You can't do that;
>> if you need to share a configuration between DS components, you have to
>> inject the ConfigurationAdmin service instead of using the @Component
>> annotation.
>>> 
>>> On Wed, Aug 10, 2016 at 3:32 AM, Remo Liechti <remo.liechti@swisslog.com
>>> 
>>> wrote:
>>> 
>>>> Hi guys
>>>> 
>>>> During starting of bundles I get the following message:
>>>> <Aug 10, 2016 8:10:42 AM CEST> <Error> <OSGiForApps> <BEA-000000>
>>>> <org.apache.felix.scr:92:Cannot use configuration
>>>> pid=com.kuka.configuration.manager for bundle 17 because it belongs to
>>>> bundle 7>
>>>> 
>>>> What does this actually mean? I have not found good information with
>>>> uncle sams google.
>>>> What I do, is the following:
>>>> - Wrap an osgi application into a j2ee web application (war file)
>>>> - Using Felix on Weblogic: https://docs.oracle.com/
>>>> middleware/1212/wls/WLPRG/osgi.htm
>>>> - My main bundle activator is called, using a servlet I start all
>>>> other bundles manually
>>>> 
>>>> 
>>>> @Resource(lookup = "java:app/osgi/Bundle") Bundle bundle;
>>>> 
>>>> BundleContext bc = bundle.getBundleContext(); for (Bundle b :
>>>> bc.getBundles()) { [....] b.start(); [...] }
>>>> 
>>>> Thanks,
>>>> Remo
>>>> 
>>>> 
>>>> This message may contain legally privileged or confidential
>>>> information and is therefore addressed to the named persons only. The
>>>> recipient should inform the sender and delete this message, if he/she
>>>> is not named as addressee. The sender disclaims any and all liability
>>>> for the integrity and punctuality of this message. The sender has
>>>> activated an automatic virus scanning, but does not guarantee the
>>>> virus free transmission of this message.
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>> 
>>>> 
>>> This message may contain legally privileged or confidential information
>> and is therefore addressed to the named persons only. The recipient should
>> inform the sender and delete this message, if he/she is not named as
>> addressee. The sender disclaims any and all liability for the integrity and
>> punctuality of this message. The sender has activated an automatic virus
>> scanning, but does not guarantee the virus free transmission of this
>> message.
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>> 
>> 
>> 
>> 
>> 
>> --
>> Carsten Ziegeler
>> Adobe Research Switzerland
>> cziegeler@apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>> 
>> 
> 
> 
> -- 
> *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
> (@rotty3000)
> Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
> (@Liferay)
> Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


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


Re: Cannot use configuration pid ... for bundle XX because it belongs to bundle YY

Posted by Raymond Auge <ra...@liferay.com>.
Carsten, are you sure about null and not the literal string "?"

- Ray

On Wed, Aug 10, 2016 at 9:57 AM, Carsten Ziegeler <cz...@apache.org>
wrote:

> > Did not find any annotation in those components, they actually get
> configured using the ConfigurationAdmin.
> >
> > Error:
> > <org.apache.felix.scr:86:Cannot use configuration pid=com.kuka.authorizationService.component
> for bundle 7 because it belongs to bundle 77>
> >
> > OSGI-LIB\*.xml:
> > <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
> activate="activate" configuration-policy="require" deactivate="deactivate"
> immediate="true" name="com.kuka.authorizationService.component">
> >    <implementation class="com.....AuthorizationServiceComponent"/>
> >    <service>
> >       <provide interface="com....IAuthorizationOsgiService"/>
> >    </service>
> >    <reference
> >       bind="setServiceRegistry"
> >       cardinality="1..1"
> >       interface="com....IServiceRegistry"
> >       name="IServiceRegistry"
> >       configuration-policy="require"
> >       policy="static"/>
> > </scr:component>
> >
> > The component itself that has no annotations at all:
> > [...]
> > import com.....IServiceRegistry;
> >
> > /**
> >  * The OSGI component for the {@link AuthorizationService}.
> >  */
> > public class AuthorizationServiceComponent implements
> IAuthorizationOsgiService
> > [...]
> >
> > The main bundle activator does the following regarding this component:
> > Dictionary<String, Object> properties = new Hashtable<String, Object>();
> > properties.put("userRolesFile", "someFileSystemPath");
> > properties.put("userCredentialsFile", "someFileSystemPath");
> > configAdmin.getConfiguration("com.kuka.authorizationService.
> component").update(properties);
>
> This is exactly your problem :) With this you bind the configuration to
> the bundle executing this code and then DS can't use it anymore. Change
> it to use the two argument getConfiguration method and pass null as the
> second argument (location).
>
> Regards
> Carsten
> >
> > Interesting that all bundles that are configured like this end in such
> an error.
> > The application I try to wrap was built in equinox and starts there
> without issues.
> >
> >
> >
> > -----Original Message-----
> > From: Benson Margulies [mailto:benson@basistech.com]
> > Sent: Mittwoch, 10. August 2016 12:46
> > To: users@felix.apache.org
> > Subject: Re: Cannot use configuration pid ... for bundle XX because it
> belongs to bundle YY
> >
> > In my experience, it means that you have annotated two different classes
> with @Component and specified the same configurationPid. You can't do that;
> if you need to share a configuration between DS components, you have to
> inject the ConfigurationAdmin service instead of using the @Component
> annotation.
> >
> > On Wed, Aug 10, 2016 at 3:32 AM, Remo Liechti <remo.liechti@swisslog.com
> >
> > wrote:
> >
> >> Hi guys
> >>
> >> During starting of bundles I get the following message:
> >> <Aug 10, 2016 8:10:42 AM CEST> <Error> <OSGiForApps> <BEA-000000>
> >> <org.apache.felix.scr:92:Cannot use configuration
> >> pid=com.kuka.configuration.manager for bundle 17 because it belongs to
> >> bundle 7>
> >>
> >> What does this actually mean? I have not found good information with
> >> uncle sams google.
> >> What I do, is the following:
> >> - Wrap an osgi application into a j2ee web application (war file)
> >> - Using Felix on Weblogic: https://docs.oracle.com/
> >> middleware/1212/wls/WLPRG/osgi.htm
> >> - My main bundle activator is called, using a servlet I start all
> >> other bundles manually
> >>
> >>
> >> @Resource(lookup = "java:app/osgi/Bundle") Bundle bundle;
> >>
> >> BundleContext bc = bundle.getBundleContext(); for (Bundle b :
> >> bc.getBundles()) { [....] b.start(); [...] }
> >>
> >> Thanks,
> >> Remo
> >>
> >>
> >> This message may contain legally privileged or confidential
> >> information and is therefore addressed to the named persons only. The
> >> recipient should inform the sender and delete this message, if he/she
> >> is not named as addressee. The sender disclaims any and all liability
> >> for the integrity and punctuality of this message. The sender has
> >> activated an automatic virus scanning, but does not guarantee the
> >> virus free transmission of this message.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> >> For additional commands, e-mail: users-help@felix.apache.org
> >>
> >>
> > This message may contain legally privileged or confidential information
> and is therefore addressed to the named persons only. The recipient should
> inform the sender and delete this message, if he/she is not named as
> addressee. The sender disclaims any and all liability for the integrity and
> punctuality of this message. The sender has activated an automatic virus
> scanning, but does not guarantee the virus free transmission of this
> message.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > For additional commands, e-mail: users-help@felix.apache.org
> >
>
>
>
>
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> cziegeler@apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)

RE: Cannot use configuration pid ... for bundle XX because it belongs to bundle YY

Posted by Remo Liechti <re...@swisslog.com>.
>> The main bundle activator does the following regarding this component:
>> Dictionary<String, Object> properties = new Hashtable<String,
>> Object>(); properties.put("userRolesFile", "someFileSystemPath");
>> properties.put("userCredentialsFile", "someFileSystemPath");
>> configAdmin.getConfiguration("com.kuka.authorizationService.component"
>> ).update(properties);

> This is exactly your problem :) With this you bind the configuration to the bundle executing this code and
> then DS can't use it anymore. Change it to use the two argument getConfiguration method and pass null as
> the second argument (location).

Passing null solved the issue, thank Carsten!
The main issue I had actually was that the application I try to bundle into a web application was using equinox and still had a dependency to equinox.cm, which resulted in a NullPointer. Replacing the equinox.cm with the felix version of it made it work.
This message may contain legally privileged or confidential information and is therefore addressed to the named persons only. The recipient should inform the sender and delete this message, if he/she is not named as addressee. The sender disclaims any and all liability for the integrity and punctuality of this message. The sender has activated an automatic virus scanning, but does not guarantee the virus free transmission of this message.

Re: Cannot use configuration pid ... for bundle XX because it belongs to bundle YY

Posted by Carsten Ziegeler <cz...@apache.org>.
> Did not find any annotation in those components, they actually get configured using the ConfigurationAdmin.
> 
> Error:
> <org.apache.felix.scr:86:Cannot use configuration pid=com.kuka.authorizationService.component for bundle 7 because it belongs to bundle 77>
> 
> OSGI-LIB\*.xml:
> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" configuration-policy="require" deactivate="deactivate" immediate="true" name="com.kuka.authorizationService.component">
>    <implementation class="com.....AuthorizationServiceComponent"/>
>    <service>
>       <provide interface="com....IAuthorizationOsgiService"/>
>    </service>
>    <reference
>       bind="setServiceRegistry"
>       cardinality="1..1"
>       interface="com....IServiceRegistry"
>       name="IServiceRegistry"
>       configuration-policy="require"
>       policy="static"/>
> </scr:component>
> 
> The component itself that has no annotations at all:
> [...]
> import com.....IServiceRegistry;
> 
> /**
>  * The OSGI component for the {@link AuthorizationService}.
>  */
> public class AuthorizationServiceComponent implements IAuthorizationOsgiService
> [...]
> 
> The main bundle activator does the following regarding this component:
> Dictionary<String, Object> properties = new Hashtable<String, Object>();
> properties.put("userRolesFile", "someFileSystemPath");
> properties.put("userCredentialsFile", "someFileSystemPath");
> configAdmin.getConfiguration("com.kuka.authorizationService.component").update(properties);

This is exactly your problem :) With this you bind the configuration to
the bundle executing this code and then DS can't use it anymore. Change
it to use the two argument getConfiguration method and pass null as the
second argument (location).

Regards
Carsten
> 
> Interesting that all bundles that are configured like this end in such an error.
> The application I try to wrap was built in equinox and starts there without issues.
> 
> 
> 
> -----Original Message-----
> From: Benson Margulies [mailto:benson@basistech.com]
> Sent: Mittwoch, 10. August 2016 12:46
> To: users@felix.apache.org
> Subject: Re: Cannot use configuration pid ... for bundle XX because it belongs to bundle YY
> 
> In my experience, it means that you have annotated two different classes with @Component and specified the same configurationPid. You can't do that; if you need to share a configuration between DS components, you have to inject the ConfigurationAdmin service instead of using the @Component annotation.
> 
> On Wed, Aug 10, 2016 at 3:32 AM, Remo Liechti <re...@swisslog.com>
> wrote:
> 
>> Hi guys
>>
>> During starting of bundles I get the following message:
>> <Aug 10, 2016 8:10:42 AM CEST> <Error> <OSGiForApps> <BEA-000000>
>> <org.apache.felix.scr:92:Cannot use configuration
>> pid=com.kuka.configuration.manager for bundle 17 because it belongs to
>> bundle 7>
>>
>> What does this actually mean? I have not found good information with
>> uncle sams google.
>> What I do, is the following:
>> - Wrap an osgi application into a j2ee web application (war file)
>> - Using Felix on Weblogic: https://docs.oracle.com/
>> middleware/1212/wls/WLPRG/osgi.htm
>> - My main bundle activator is called, using a servlet I start all
>> other bundles manually
>>
>>
>> @Resource(lookup = "java:app/osgi/Bundle") Bundle bundle;
>>
>> BundleContext bc = bundle.getBundleContext(); for (Bundle b :
>> bc.getBundles()) { [....] b.start(); [...] }
>>
>> Thanks,
>> Remo
>>
>>
>> This message may contain legally privileged or confidential
>> information and is therefore addressed to the named persons only. The
>> recipient should inform the sender and delete this message, if he/she
>> is not named as addressee. The sender disclaims any and all liability
>> for the integrity and punctuality of this message. The sender has
>> activated an automatic virus scanning, but does not guarantee the
>> virus free transmission of this message.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
> This message may contain legally privileged or confidential information and is therefore addressed to the named persons only. The recipient should inform the sender and delete this message, if he/she is not named as addressee. The sender disclaims any and all liability for the integrity and punctuality of this message. The sender has activated an automatic virus scanning, but does not guarantee the virus free transmission of this message.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


 

-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org


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


RE: Cannot use configuration pid ... for bundle XX because it belongs to bundle YY

Posted by Remo Liechti <re...@swisslog.com>.
Did not find any annotation in those components, they actually get configured using the ConfigurationAdmin.

Error:
<org.apache.felix.scr:86:Cannot use configuration pid=com.kuka.authorizationService.component for bundle 7 because it belongs to bundle 77>

OSGI-LIB\*.xml:
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" configuration-policy="require" deactivate="deactivate" immediate="true" name="com.kuka.authorizationService.component">
   <implementation class="com.....AuthorizationServiceComponent"/>
   <service>
      <provide interface="com....IAuthorizationOsgiService"/>
   </service>
   <reference
      bind="setServiceRegistry"
      cardinality="1..1"
      interface="com....IServiceRegistry"
      name="IServiceRegistry"
      configuration-policy="require"
      policy="static"/>
</scr:component>

The component itself that has no annotations at all:
[...]
import com.....IServiceRegistry;

/**
 * The OSGI component for the {@link AuthorizationService}.
 */
public class AuthorizationServiceComponent implements IAuthorizationOsgiService
[...]

The main bundle activator does the following regarding this component:
Dictionary<String, Object> properties = new Hashtable<String, Object>();
properties.put("userRolesFile", "someFileSystemPath");
properties.put("userCredentialsFile", "someFileSystemPath");
configAdmin.getConfiguration("com.kuka.authorizationService.component").update(properties);

Interesting that all bundles that are configured like this end in such an error.
The application I try to wrap was built in equinox and starts there without issues.



-----Original Message-----
From: Benson Margulies [mailto:benson@basistech.com]
Sent: Mittwoch, 10. August 2016 12:46
To: users@felix.apache.org
Subject: Re: Cannot use configuration pid ... for bundle XX because it belongs to bundle YY

In my experience, it means that you have annotated two different classes with @Component and specified the same configurationPid. You can't do that; if you need to share a configuration between DS components, you have to inject the ConfigurationAdmin service instead of using the @Component annotation.

On Wed, Aug 10, 2016 at 3:32 AM, Remo Liechti <re...@swisslog.com>
wrote:

> Hi guys
>
> During starting of bundles I get the following message:
> <Aug 10, 2016 8:10:42 AM CEST> <Error> <OSGiForApps> <BEA-000000>
> <org.apache.felix.scr:92:Cannot use configuration
> pid=com.kuka.configuration.manager for bundle 17 because it belongs to
> bundle 7>
>
> What does this actually mean? I have not found good information with
> uncle sams google.
> What I do, is the following:
> - Wrap an osgi application into a j2ee web application (war file)
> - Using Felix on Weblogic: https://docs.oracle.com/
> middleware/1212/wls/WLPRG/osgi.htm
> - My main bundle activator is called, using a servlet I start all
> other bundles manually
>
>
> @Resource(lookup = "java:app/osgi/Bundle") Bundle bundle;
>
> BundleContext bc = bundle.getBundleContext(); for (Bundle b :
> bc.getBundles()) { [....] b.start(); [...] }
>
> Thanks,
> Remo
>
>
> This message may contain legally privileged or confidential
> information and is therefore addressed to the named persons only. The
> recipient should inform the sender and delete this message, if he/she
> is not named as addressee. The sender disclaims any and all liability
> for the integrity and punctuality of this message. The sender has
> activated an automatic virus scanning, but does not guarantee the
> virus free transmission of this message.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
This message may contain legally privileged or confidential information and is therefore addressed to the named persons only. The recipient should inform the sender and delete this message, if he/she is not named as addressee. The sender disclaims any and all liability for the integrity and punctuality of this message. The sender has activated an automatic virus scanning, but does not guarantee the virus free transmission of this message.

Re: Cannot use configuration pid ... for bundle XX because it belongs to bundle YY

Posted by Benson Margulies <be...@basistech.com>.
In my experience, it means that you have annotated two different classes
with @Component and specified the same configurationPid. You can't do that;
if you need to share a configuration between DS components, you have to
inject the ConfigurationAdmin service instead of using the @Component
annotation.

On Wed, Aug 10, 2016 at 3:32 AM, Remo Liechti <re...@swisslog.com>
wrote:

> Hi guys
>
> During starting of bundles I get the following message:
> <Aug 10, 2016 8:10:42 AM CEST> <Error> <OSGiForApps> <BEA-000000>
> <org.apache.felix.scr:92:Cannot use configuration
> pid=com.kuka.configuration.manager for bundle 17 because it belongs to
> bundle 7>
>
> What does this actually mean? I have not found good information with uncle
> sams google.
> What I do, is the following:
> - Wrap an osgi application into a j2ee web application (war file)
> - Using Felix on Weblogic: https://docs.oracle.com/
> middleware/1212/wls/WLPRG/osgi.htm
> - My main bundle activator is called, using a servlet I start all other
> bundles manually
>
>
> @Resource(lookup = "java:app/osgi/Bundle")
> Bundle bundle;
>
> BundleContext bc = bundle.getBundleContext();
> for (Bundle b : bc.getBundles()) {
> [....]
> b.start();
> [...]
> }
>
> Thanks,
> Remo
>
>
> This message may contain legally privileged or confidential information
> and is therefore addressed to the named persons only. The recipient should
> inform the sender and delete this message, if he/she is not named as
> addressee. The sender disclaims any and all liability for the integrity and
> punctuality of this message. The sender has activated an automatic virus
> scanning, but does not guarantee the virus free transmission of this
> message.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>