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 2017/04/12 04:07:41 UTC

[jira] [Commented] (FELIX-5613) SCR bundle fails to start without Config Admin

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

David Jencks commented on FELIX-5613:
-------------------------------------

So here's the culprit, if my copy of the code is accurate:

    public RegionConfigurationSupport registerRegionConfigurationSupport(
            ServiceReference<ConfigurationAdmin> reference) {

Why doesn't type erasure eliminate all reference to config admin???

I imagine we can fix this by using ServiceReference<?> and casting it in the RegionConfigurationSupport constructor, but I'd like to know how my understanding of generics is wrong.

> SCR bundle fails to start without Config Admin
> ----------------------------------------------
>
>                 Key: FELIX-5613
>                 URL: https://issues.apache.org/jira/browse/FELIX-5613
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>            Reporter: Neil Bartlett
>
> SCR 2.0.8 still imports package {{org.osgi.service.cm}} as optional, but it does not start when there is no export of that package available.
> I know that SCR should be able to work without a Config Admin implementation but it clearly does not work at all without an import of the API package, therefore it should not be marked as an optional import.
> Stack trace:
> {noformat}
> ! Failed to start bundle org.apache.felix.scr-2.0.8, exception activator error org/osgi/service/cm/ConfigurationListener from: java.lang.ClassLoader:defineClass1#-2
> org.osgi.framework.BundleException: Activator start error in bundle org.apache.felix.scr [5].
>         at org.apache.felix.framework.Felix.activateBundle(Felix.java:2276)
>         at org.apache.felix.framework.Felix.startBundle(Felix.java:2144)
>         [... snip ...]
> Caused by: java.lang.NoClassDefFoundError: org/osgi/service/cm/ConfigurationListener
>         at java.lang.ClassLoader.defineClass1(Native Method)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
>         at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2370)
>         at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2154)
>         at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1542)
>         at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
>         at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>         at org.apache.felix.scr.impl.Activator.doStart(Activator.java:157)
>         at org.apache.felix.utils.extender.AbstractExtender.start(AbstractExtender.java:114)
>         at org.apache.felix.scr.impl.Activator.restart(Activator.java:142)
>         at org.apache.felix.scr.impl.config.ScrConfigurationImpl.configure(ScrConfigurationImpl.java:196)
>         at org.apache.felix.scr.impl.config.ScrConfigurationImpl.start(ScrConfigurationImpl.java:117)
>         at org.apache.felix.scr.impl.Activator.start(Activator.java:110)
>         at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697)
>         at org.apache.felix.framework.Felix.activateBundle(Felix.java:2226)
>         ... 11 more
> Caused by: java.lang.ClassNotFoundException: org.osgi.service.cm.ConfigurationListener not found by org.apache.felix.scr [5]
>         at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)
>         at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
>         at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>         ... 27 more
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)