[ 
https://issues.apache.org/jira/browse/FELIX-4209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13987497#comment-13987497
 ] 

Christoph Läubrich commented on FELIX-4209:
-------------------------------------------

>  The class with the exception isn't in the current code base  under that name 
> making it difficult to track
As mentioned in the bug data this was encountered with the scr-1.6.0 version

> I thought in the current code we generally check that the CA object we get
> from the service reference is an instance of the CA class we load

If thats the case than this could be marked as resolved

> SCR seems to loads ConfigAdmin class through DS bundle
> ------------------------------------------------------
>
>                 Key: FELIX-4209
>                 URL: https://issues.apache.org/jira/browse/FELIX-4209
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions:  scr-1.6.0
>            Reporter: Christoph Läubrich
>
> I have the following scenario:
> - Equinox Service bundle providing org.osgi.service.cm version="1.3.0"
> - DS Component using  org.osgi.service.cm in version="1.3.0"
> - Felix ConfiguarationAdmin providing version="1.5.0"
> - Felix SCR
> The component fails to initilize because of a ClassCastException that the 
> Apache Felix CM impl can't be cast to org.osgi.service.cm.ConfigurationAdmin
> MESSAGE [-component name-] Cannot register Component
> !STACK 0
> java.lang.ClassCastException: org.apache.felix.cm.impl.ConfigurationAdminImpl 
> cannot be cast to org.osgi.service.cm.ConfigurationAdmin
>       at 
> org.apache.felix.scr.impl.config.ConfigurationComponentRegistry.createComponentHolder(ConfigurationComponentRegistry.java:125)
>       at 
> org.apache.felix.scr.impl.BundleComponentActivator.loadDescriptor(BundleComponentActivator.java:244)
>       at 
> org.apache.felix.scr.impl.BundleComponentActivator.initialize(BundleComponentActivator.java:147)
>       at 
> org.apache.felix.scr.impl.BundleComponentActivator.<init>(BundleComponentActivator.java:111)
>       at 
> org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:285)
>       at org.apache.felix.scr.impl.Activator.bundleChanged(Activator.java:203)
>       at 
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:847)
>       at 
> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
>       at 
> org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
>       at 
> org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged(Framework.java:1523)
>       at 
> org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1459)
>       at 
> org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1454)
>       at 
> org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:391)
>       at 
> org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>       at 
> org.eclipse.osgi.framework.internal.core.PackageAdminImpl.resumeBundles(PackageAdminImpl.java:313)
>       at 
> org.eclipse.osgi.framework.internal.core.PackageAdminImpl.processDelta(PackageAdminImpl.java:557)
>       at 
> org.eclipse.osgi.framework.internal.core.PackageAdminImpl.doResolveBundles(PackageAdminImpl.java:253)
>       at 
> org.eclipse.osgi.framework.internal.core.PackageAdminImpl$1.run(PackageAdminImpl.java:173)
>       at java.lang.Thread.run(Unknown Source)
> It seems as if the SCR Bundle is fetching either the service or the Class 
> through the DS bundle and thus is getting a wrong reference.
> Changing the DS providing bundle to use cm in version 1.5 fixes the issue, 
> but of course makes it impossible for it to use an older package version.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to