Failed to start bundle org.apache.felix.scr-2.0.6

268 views
Skip to first unread message

Dixie Sebastian

unread,
Sep 27, 2016, 11:35:32 AM9/27/16
to bndtools-users

Hello,

I have just updated my bndtools installation to 3.3.0.
I created a bndtools cnf workspace (not the enroute one).
Then created a simple Component type OSGi project.
The added the component jar to launch.bndrun.

After successful resolution I did Run OSgi, I get this error and I notice scr is not loaded.

Failed to start bundle org.apache.felix.scr-2.0.6, exception activator error org/osgi/service/cm/ConfigurationListener from: java.lang.ClassLoader:defineClass1#-2

Kindly help.


I have logged an issue for the same here https://github.com/bndtools/bndtools/issues/1554

David Jencks

unread,
Sep 27, 2016, 4:00:37 PM9/27/16
to bndtool...@googlegroups.com
Is there more stack trace?  We try to make config admin optional for felix scr, maybe we didn’t succeed.

thanks
david jencks

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dixie Raj

unread,
Sep 27, 2016, 9:39:55 PM9/27/16
to bndtool...@googlegroups.com

True. I found two work arounds.
1. Download and add the cm service
2. Downgrade scr to 2.0.2

Both worked for me. I'm not what I might miss because of this.

~Dixie


To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "bndtools-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bndtools-users/U6nOsvmo67o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bndtools-users+unsubscribe@googlegroups.com.

Kristian Zeller

unread,
Oct 1, 2016, 3:03:42 PM10/1/16
to bndtools-users
hi, i can confirm.

in order to make it run i had to had to add org.apache.felix.configadmin and org.apache.felix.metatype.

Shouldn't this be resolved by bndtools? or is felic.scr missing those dependencies?

cheers

David Jencks

unread,
Oct 1, 2016, 3:31:19 PM10/1/16
to bndtool...@googlegroups.com
let me repeat my request FOR MORE COMPLETE STACK TRACE.

The intent is that cm and metatype are both optional.

thanks
david jencks

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.

BJ Hargrave

unread,
Oct 3, 2016, 2:24:31 PM10/3/16
to bndtool...@googlegroups.com
I also encountered this when upgrading Felix SCR to 2.0.6 in the OSGi build:

! Failed to start bundle org.apache.felix.scr-2.0.6, exception activator error org/osgi/service/cm/ConfigurationListener from: java.lang.ClassLoader:defineClass1#-2
org.osgi.framework.BundleException: Exception in org.apache.felix.scr.impl.Activator.start() of bundle org.apache.felix.scr.
        at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:795)
        at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:724)
        at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:955)
        at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:308)
        at org.eclipse.osgi.container.Module.doStart(Module.java:581)
        at org.eclipse.osgi.container.Module.start(Module.java:449)
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:382)
        at aQute.launcher.Launcher.update(Launcher.java:483)
        at aQute.launcher.Launcher.activate(Launcher.java:382)
        at aQute.launcher.Launcher.run(Launcher.java:276)
        at aQute.launcher.Launcher.main(Launcher.java:133)
Caused by: java.lang.NoClassDefFoundError: org/osgi/service/cm/ConfigurationListener
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:273)
        at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:632)
        at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:586)
        at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:538)
        at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:525)
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:325)
        at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:345)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:423)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364)
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
        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.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:774)
        at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:767)
        ... 10 more
Caused by: java.lang.ClassNotFoundException: org.osgi.service.cm.ConfigurationListener cannot be found by org.apache.felix.scr_2.0.6
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:461)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364)
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 34 more

--
--
BJ

David Jencks

unread,
Oct 3, 2016, 2:42:54 PM10/3/16
to bndtool...@googlegroups.com
What version was it at before?  I don’t think this part has changed in a while.

Do you happen to know which of these causes the problem?  (note public abstract class RegionConfigurationSupport implements ConfigurationListener)

1.     private final ConcurrentMap<Long, RegionConfigurationSupport> bundleToRcsMap = new ConcurrentHashMap<Long, RegionConfigurationSupport>();


2.         RegionConfigurationSupport trialRcs = new RegionConfigurationSupport(m_logger, reference) {
            @Override
            protected Collection<ComponentHolder<?>> getComponentHolders(TargetedPID pid)
            {
                return ComponentRegistry.this.getComponentHoldersByPid(pid);
            }
        };

3. Something else….

david jencks

BJ Hargrave

unread,
Oct 3, 2016, 2:49:10 PM10/3/16
to bndtool...@googlegroups.com
It was 2.0.0 before. Also, running with Java 8. Don't know what causes the problem, but if I make sure cm package is exported by another bundle, Felix SCR properly starts.
Reply all
Reply to author
Forward
0 new messages