You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "David Jencks (JIRA)" <ji...@apache.org> on 2014/04/30 03:50:14 UTC

[jira] [Commented] (FELIX-4209) SCR seems to loads ConfigAdmin class through DS bundle

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

David Jencks commented on FELIX-4209:
-------------------------------------

I don't understand what you want.  The class with the exception isn't in the current code base under that name making it difficult to track down.  If you still think this is a problem and can reproduce it with current code, I'll take another look.

We absolutely have to get the config admin instance for the bundle we are extending.  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, but maybe there's somewhere we've missed.

If you run a system where the CA spec classes are from 2 bundles at different versions and the implementation doesn't wire to the version scr wires to, you will be in trouble.  The practical solution is to only have one version of the CA classes and the impractical solution is to install stuff in isolated subsystems.

> 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)