[
https://issues.apache.org/jira/browse/FELIX-4209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Christoph Läubrich updated FELIX-4209:
--------------------------------------
Description:
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.
was:
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
{code}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) {code}
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.
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira