5 Replies Latest reply on Oct 19, 2011 3:26 AM by eruiz_eruiz

    FUSE 4.4 Feature Install NoClassDefFoundError/Console Dead

    dustin_dustin.schultz

      Hi,

       

      I'm upgrading from Fuse 4.2 to Fuse 4.4. I have a feature that consists of several other features (an "uber-feature") that installs fine on 4.2 however, it throws several seemingly random NoClassDefFoundErrors when trying to install on 4.4.

       

      The NoClassDefFoundErrors always occur right after the "Refreshing bundles" message comes up.

       

      I have tried installing each of the features that exist in this "uber-feature" and when they are individually installed - it works fine. I get no refreshing bundles messages and everything is in Active state.

       

      -


      karaf@root> features:install further-provisions

      Refreshing bundles org.apache.activemq.activemq-console (46), org.springframework.core (73), org.springframework.context.support (69), org.apache.servicemix.bundles.jdom (61), org.springframework.beans (68), wrap_mvn_org.apache.poi_poi-ooxml_3.7 (217), org.apache.cxf.bundle (123), org.springframework.aop (74), org.springframework.context (70)

      ERROR: Bundle org.apache.servicemix.jbi.deployer EventDispatcher: Error during dispatch. (java.lang.NoClassDefFoundError: org/apache/servicemix/nmr/api/service/ServiceHelper)

      java.lang.NoClassDefFoundError: org/apache/servicemix/nmr/api/service/ServiceHelper

           at org.apache.servicemix.jbi.runtime.impl.ComponentContextImpl.deactivateEndpoint(ComponentContextImpl.java:129)

           at org.apache.servicemix.common.endpoints.ProviderEndpoint.deactivate(ProviderEndpoint.java:66)

           at org.apache.servicemix.common.DefaultServiceUnit.shutDown(DefaultServiceUnit.java:126)

           at org.apache.servicemix.common.DefaultComponent.doShutDown(DefaultComponent.java:369)

           at org.apache.servicemix.wsn.component.WSNComponent.doShutDown(WSNComponent.java:197)

           at org.apache.servicemix.common.AsyncBaseLifeCycle.shutDown(AsyncBaseLifeCycle.java:259)

           at org.apache.servicemix.jbi.deployer.artifacts.ComponentImpl$ComponentWrapper.shutDown(ComponentImpl.java:277)

           at org.apache.servicemix.jbi.deployer.artifacts.ComponentImpl.shutDown(ComponentImpl.java:182)

           at org.apache.servicemix.jbi.deployer.impl.Deployer.unregisterComponent(Deployer.java:452)

           at org.apache.servicemix.jbi.deployer.impl.Deployer.unregisterDeployedComponent(Deployer.java:676)

           at org.apache.servicemix.jbi.deployer.impl.Deployer$1.removedService(Deployer.java:223)

           at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:922)

           at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:351)

           at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:865)

           at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:859)

           at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:721)

           at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:649)

           at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3762)

           at org.apache.felix.framework.Felix.access$000(Felix.java:79)

           at org.apache.felix.framework.Felix$2.serviceChanged(Felix.java:723)

           at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:135)

           at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:129)

           at org.apache.aries.blueprint.container.ServiceRecipe.unregister(ServiceRecipe.java:201)

           at org.apache.aries.blueprint.container.BlueprintContainerImpl.notifySatisfaction(BlueprintContainerImpl.java:615)

           at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.setSatisfied(AbstractServiceReferenceRecipe.java:305)

           at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.serviceRemoved(AbstractServiceReferenceRecipe.java:281)

           at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.serviceChanged(AbstractServiceReferenceRecipe.java:251)

           at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:859)

           at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:721)

           at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:649)

           at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3762)

           at org.apache.felix.framework.Felix.access$000(Felix.java:79)

           at org.apache.felix.framework.Felix$2.serviceChanged(Felix.java:723)

           at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:135)

           at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:129)

           at org.apache.aries.blueprint.container.ServiceRecipe.unregister(ServiceRecipe.java:201)

           at org.apache.aries.blueprint.container.BlueprintContainerImpl.unregisterServices(BlueprintContainerImpl.java:673)

           at org.apache.aries.blueprint.container.BlueprintContainerImpl.namespaceHandlerUnregistered(BlueprintContainerImpl.java:866)

           at org.apache.aries.blueprint.namespace.NamespaceHandlerRegistryImpl$NamespaceHandlerSetImpl.unregisterHandler(NamespaceHandlerRegistryImpl.java:365)

           at org.apache.aries.blueprint.namespace.NamespaceHandlerRegistryImpl.unregisterHandler(NamespaceHandlerRegistryImpl.java:149)

           at org.apache.aries.blueprint.namespace.NamespaceHandlerRegistryImpl.removedService(NamespaceHandlerRegistryImpl.java:119)

           at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:922)

           at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:351)

           at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:865)

           at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:859)

           at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:721)

           at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:649)

           at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3762)

           at org.apache.felix.framework.Felix.access$000(Felix.java:79)

           at org.apache.felix.framework.Felix$2.serviceChanged(Felix.java:723)

           at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:135)

           at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:129)

           at org.apache.aries.blueprint.container.ServiceRecipe.unregister(ServiceRecipe.java:201)

           at org.apache.aries.blueprint.container.BlueprintContainerImpl.unregisterServices(BlueprintContainerImpl.java:673)

           at org.apache.aries.blueprint.container.BlueprintContainerImpl.destroy(BlueprintContainerImpl.java:822)

           at org.apache.aries.blueprint.container.BlueprintExtender.destroyContext(BlueprintExtender.java:250)

           at org.apache.aries.blueprint.container.BlueprintExtender.bundleChanged(BlueprintExtender.java:242)

           at org.apache.aries.blueprint.container.BlueprintExtender$BlueprintBundleTrackerCustomizer.modifiedBundle(BlueprintExtender.java:431)

           at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:453)

           at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:237)

           at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:413)

           at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:795)

           at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:717)

           at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:597)

           at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3751)

           at org.apache.felix.framework.Felix.stopBundle(Felix.java:2200)

           at org.apache.felix.framework.Felix$RefreshHelper.stop(Felix.java:4554)

           at org.apache.felix.framework.Felix.refreshPackages(Felix.java:3571)

           at org.apache.felix.framework.PackageAdminImpl.run(PackageAdminImpl.java:365)

           at java.lang.Thread.run(Thread.java:680)

      Caused by: java.lang.ClassNotFoundException: org.apache.servicemix.nmr.api.service.ServiceHelper not found by org.apache.servicemix.jbi.runtime

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

           ... 70 more

      org.springframework.osgi.extender[org.springframework.osgi.extender.internal.util.concurrent.RunnableTimedExecution] : Closing runnable for context OsgiBundleXmlApplicationContext(bundle=servicemix-cxf-se, config=osgibundle:/META-INF/spring/*.xml) did not finish in 10000ms; consider taking a snapshot and then shutdown the VM in case the thread still hangs

      ERROR: Bundle org.apache.servicemix.jbi.deployer EventDispatcher: Error during dispatch. (java.lang.NoClassDefFoundError: javax/xml/parsers/DocumentBuilderFactory)

      java.lang.NoClassDefFoundError: javax/xml/parsers/DocumentBuilderFactory

           at org.apache.cxf.common.logging.LogUtils.(BusFactory.java:71)

           at org.apache.servicemix.cxfse.CxfSeComponent.doShutDown(CxfSeComponent.java:96)

           at org.apache.servicemix.common.AsyncBaseLifeCycle.shutDown(AsyncBaseLifeCycle.java:259)

           at org.apache.servicemix.jbi.deployer.artifacts.ComponentImpl$ComponentWrapper.shutDown(ComponentImpl.java:277)

           at org.apache.servicemix.jbi.deployer.artifacts.ComponentImpl.shutDown(ComponentImpl.java:182)

           at org.apache.servicemix.jbi.deployer.impl.Deployer.unregisterComponent(Deployer.java:452)

           at org.apache.servicemix.jbi.deployer.impl.Deployer.unregisterDeployedComponent(Deployer.java:676)

           at org.apache.servicemix.jbi.deployer.impl.Deployer$1.removedService(Deployer.java:223)

           at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:922)

           at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:351)

           at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:865)

           at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:859)

           at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:721)

           at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:649)

           at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3762)

           at org.apache.felix.framework.Felix.access$000(Felix.java:79)

           at org.apache.felix.framework.Felix$2.serviceChanged(Felix.java:723)

           at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:135)

           at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:129)

           at org.apache.felix.framework.ServiceRegistry.unregisterServices(ServiceRegistry.java:178)

           at org.apache.felix.framework.Felix.stopBundle(Felix.java:2228)

           at org.apache.felix.framework.Felix$RefreshHelper.stop(Felix.java:4554)

           at org.apache.felix.framework.Felix.refreshPackages(Felix.java:3571)

           at org.apache.felix.framework.PackageAdminImpl.run(PackageAdminImpl.java:365)

           at java.lang.Thread.run(Thread.java:680)

      Caused by: java.lang.ClassNotFoundException: javax.xml.parsers.DocumentBuilderFactory not found by org.apache.cxf.bundle

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

           ... 26 more

       

      -


       

      The class defs that are not found seem to vary from time to time. Sometimes they are javax.jms classes.

       

      All of these classes do exist on the bus.

       

      I've set my MaxPerm space to 1G as well to make sure I'm not running out of memory.

       

      Edited by: dustin on Jul 22, 2011 11:25 PM

        • 1. Re: FUSE 4.4 Feature Install NoClassDefFoundError/Console Dead
          eruiz_eruiz

          Hi all, I have the same issue in SMX4.4:

           

          -


          karaf@root> features:install MY-FEATURE

          Refreshing bundles org.springframework.aop (73), org.springframework.beans (67), org.springframework.core (72), org.springframework.context.support (68), org.springframework.context (69)

          ERROR: Bundle org.springframework.osgi.extender \[78\] 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:662)

          Caused by: java.lang.ClassNotFoundException: org.osgi.framework.ServiceRegistration not found by org.springframework.osgi.core \[75\]

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

               ... 11 more

          -


           

          Any help will be welcome.

           

          Thanks

           

          Edited by: eruiz on Oct 18, 2011 5:48 PM

          • 2. Re: FUSE 4.4 Feature Install NoClassDefFoundError/Console Dead
            ffang

            Hi,

             

            This could be that  your feature have some package which is optional import for the spring bundles and this could cause spring bundles refresh, which could cause  lots of bundles which use spring refresh, unfortunately, now felix has a problem to handle this case.

             

            The workaround I can come up with is 2 option

            simple one

            1. edit etc/config.properties

            change

            karaf.framework=felix

            to

            karaf.framework=equinox

             

            or If you must use felix

            2. you can figure out which package of bundle from your feature is optional for the spring, so add that feature to the featuresBoot list(etc/org.apache.karaf.features.cfg), this make the spring bundles get optional import package at very first place and so avoid the later refresh.

             

            You  need remove data folder(clean up the bundle cache) after those changes.

            Freeman

            • 3. Re: FUSE 4.4 Feature Install NoClassDefFoundError/Console Dead
              eruiz_eruiz

              Many thanks Freeman, move to Equinox solves the problem.

               

              Just one question, I don't understand what do you mean with "some package which is optional import for the spring bundles", please, can you explain a bit more?

               

              Thanks!

              • 4. Re: FUSE 4.4 Feature Install NoClassDefFoundError/Console Dead
                ffang

                Hi,

                 

                Let's say spring-context bundle have an optional import package x.y.z, this package isn't available when install spring feature, as it's optional import, so spring-context bundle can still get resolved and started.

                 

                Later on you install a customer feature which have a bundle contain the package x.y.z, as this optional import package for spring-context is available in the OSGi container now, this can cause spring-context  refresh, also can cause other bundles which rely on(likely import package from spring-context) spring-context refresh, as there would be lots of bundles which rely on spring, so this can cause lots of refresh(like a chain action).

                 

                Hope this helps.

                Freeman

                • 5. Re: FUSE 4.4 Feature Install NoClassDefFoundError/Console Dead
                  eruiz_eruiz

                  Yeah, it's clear.

                   

                  Many thanks.

                   

                  Enrique