[ 
https://issues.apache.org/jira/browse/FELIX-2325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Felix Meschberger resolved FELIX-2325.
--------------------------------------

    Fix Version/s:  scr-1.4.2
       Resolution: Fixed

Thanks for reporting this issue.

You are right, that components without the name attribute must be supported. 
There is kind of a rece condition, though, in that the component name is needed 
for reservation purposes in the component registry before the 
ComponentMetadata.validate method actually sets the field to the implementation 
class name. As a consequence the name is not really reserved and later actual 
registration fails, because the name entry is missing in the registry.

Fixed in Rev. 941383 by having the ComponentMetadata.getName() method to always 
fall back to returning the implementation class name if the component name has 
not been explicitly declared.

> SCR says that my component is registered twice
> ----------------------------------------------
>
>                 Key: FELIX-2325
>                 URL: https://issues.apache.org/jira/browse/FELIX-2325
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions:  scr-1.4.0
>            Reporter: Guillaume Sauthier
>            Assignee: Felix Meschberger
>             Fix For:  scr-1.4.2
>
>
> I've got the following exception when SCR starts my component:
> 2010-05-05 15:00:58,389 : LoggerService.log : 
> [org.ow2.easybeans.proxy.factory.RemoteCallFactory] Cannot register Component
> org.osgi.service.component.ComponentException: The component name 
> 'org.ow2.easybeans.proxy.factory.RemoteCallFactory' has already been 
> registered.
>       at 
> org.apache.felix.scr.impl.ComponentRegistry.registerComponent(ComponentRegistry.java:291)
>       at 
> org.apache.felix.scr.impl.BundleComponentActivator.loadDescriptor(BundleComponentActivator.java:247)
>       at 
> org.apache.felix.scr.impl.BundleComponentActivator.initialize(BundleComponentActivator.java:147)
> My XML declaration files is the following:
> <component xmlns="http://www.osgi.org/xmlns/scr/v1.1.0";>
>   <implementation class="org.ow2.easybeans.proxy.factory.RemoteCallFactory" />
>   <service>
>     <provide interface="javax.naming.spi.ObjectFactory" />
>     <provide interface="org.ow2.easybeans.proxy.factory.RemoteCallFactory" />
>   </service>
> </component>
> As you can see, there is no 'name' attribute (The spec says that by default 
> the implementation classname is used).
> I'm sure that the component is not present in 2 bundles, so the default name 
> should be unique.
> As a workaround, if I set the 'name' attribute, everything works well, but as 
> the XML schema (and the spec) says that it is optional, I think that SCR 
> should support that use case.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to