Hello,

I have two versions of an OSGi bundle which use declarative services. Both
bundles use identical files for their component.xml file and hence use the
same component name. Equinox runs both components and creates services and
resolves references correctly. Felix throws an exception when trying to
start the version 2 bundle since the component name is already used for
version 1. From the OSGi spec, it is not clear whether it is permissible to
have multiple DS components with the same name. It does say "The name of a
component must be globally unique because it is used as a PID in several
places". Since in this case, the components have identical configurations,
should the runtime prevent the starting of the bundle? I dont think Equinox
does any checks for duplicate component names.


   --- [RetailerComponent1] Exception with component : Cannot register
Component ---

   *org.osgi.service.component.ComponentException*: The component name
'RetailerComponent1' has already been registered.

   at org.apache.felix.scr.ComponentRegistry.checkComponentName(*
ComponentRegistry.java:102*)

   at org.apache.felix.scr.BundleComponentActivator.initialize(*
BundleComponentActivator.java:139*)

   at org.apache.felix.scr.BundleComponentActivator.<init>(*
BundleComponentActivator.java:90*)

   at org.apache.felix.scr.Activator.loadComponents(*Activator.java:208*)

   at org.apache.felix.scr.Activator.bundleChanged(*Activator.java:157*)

   at
org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback
(*EventDispatcher.java:637*)

   at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(
*EventDispatcher.java:566*)

   at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(*
EventDispatcher.java:480*)

   at org.apache.felix.framework.Felix.fireBundleEvent(*Felix.java:3366*)

   at org.apache.felix.framework.Felix._startBundle(*Felix.java:1315*)

   at org.apache.felix.framework.Felix.startBundle(*Felix.java:1243*)

   at org.apache.felix.framework.BundleImpl.start(*BundleImpl.java:350*)


--
Thank you...

Regards,

Rajini

Reply via email to