Refreshing highly dependent bundles crashes Felix but not Equinox
dustin_dustin.schultz Feb 15, 2012 11:14 AMHi,
Whenever a highly dependent bundle is refreshed (e.g. after a feature install), Felix proceeds to try and refresh all related bundles and always fails with a random ClassNotFoundError. The class not found is different each time.
To reproduce, with a fresh install, wait until all bundles are resolved and blueprints are created, then refresh spring-core. If you're using Felix (the default) it will eventually lock up or commands won't work (e.g. refresh is not a command). Do the same with Equinox and no problems.
In the example below, 78 is Spring Core
karaf@root> refresh 78 karaf@root> ERROR: Bundle org.springframework.osgi.extender [84] Error stopping bundle. (java.lang.NoClassDefFoundError: org/osgi/framework/ServiceRegistration) java.lang.NoClassDefFoundError: org/osgi/framework/ServiceRegistration at org.springframework.osgi.util.OsgiServiceUtils.unregisterService(OsgiServiceUtils.java:41) at org.springframework.osgi.extender.internal.support.NamespaceManager.unregisterResolverService(NamespaceManager.java:195) at org.springframework.osgi.extender.internal.support.NamespaceManager.destroy(NamespaceManager.java:223) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener.shutdown(ContextLoaderListener.java:547) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener.stop(ContextLoaderListener.java:431) at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:651) at org.apache.felix.framework.Felix.stopBundle(Felix.java:2225) at org.apache.felix.framework.Felix$RefreshHelper.stop(Felix.java:4573) at org.apache.felix.framework.Felix.refreshPackages(Felix.java:3590) at org.apache.felix.framework.PackageAdminImpl.run(PackageAdminImpl.java:365) at java.lang.Thread.run(Thread.java:680) Caused by: java.lang.ClassNotFoundException: org.osgi.framework.ServiceRegistration not found by org.springframework.osgi.core [81] at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:812) at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:72) at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1806) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 11 more *ERROR* Cannot use factory configuration org.apache.aries.transaction for [org.osgi.service.cm.ManagedServiceFactory, id=468, bundle=123]: Configuration bound to bundle mvn:org.apache.aries.transaction/org.apache.aries.transaction.manager/0.2-incubating karaf@root> karaf@root> refresh 76 Command not found: refresh
Killing the process is required at this point.
I've tried adjusting the JVM memory parameters as well but that does not seem to have any affect.
Is this a known issue? I could only find this: https://issues.apache.org/jira/browse/FELIX-3153 which says it was not reproducible.
Dustin
Edited by: dustin on Feb 15, 2012 4:14 PM