6 Replies Latest reply on Aug 4, 2009 11:24 PM by Oren Livne

    osgi/update does not seem to update bundle

    Oren Livne Novice

      When I run "mvn clean install" on my maven OSGi project and use "osgi/update <bundle_number"> to update it on FUSE 4.1.0.0, it still uses the old source. Even if I uninstall and reinstall from mvn (install -s mvn:...), it uses the old source.

       

      However, when I quit FUSE and come back in, the new source is used. How can I prevent this caching?

        • 1. Re: osgi/update does not seem to update bundle
          Stan Lewis Novice

          just curious what components are you using in your bundle, and also how are you verifying that the new version hasn't been picked up?  Also have you tried copying the bundle into the "deploy" directory to see if the behavior is different?  I'd like to try and reproduce this here if possible so any guidance you can pass on is appreciated...

          • 2. Re: osgi/update does not seem to update bundle
            Oren Livne Novice

            Hi Sergey,

             

            It turns out that "refresh x" updates to the latest code (as well as refreshes all dependent bundles) and "update x" does not. I am verifying it via log.debug() printouts that I change to see if they are changed in the log.

             

            I am using camel-cxf, camel-jms, camel-osgi. I wrote a script to load everything I need from a fresh FUSE ESB 4.1.0.0 built from source on my Windows XP / JDK 1.6.0_10 machine. I am including it so that you can see exactly what I am doing:

             

            #%%%%%%%%%%%%%%%%%%%%%% IMPORTANT - PLEASE READ %%%%%%%%%%%%%%%%%%%%%%

            #

            1. Before camel-cxf can be properly installed on 4.1.0.0,

            2. Copy the jetty file into system directory first as explained in

            3. http://fusesource.com/issues/browse/ESB-702 , due to a bug in this ESB version.

            #

            1. ... blog entry follows ...

            #

            1. One workaround to get around this issue for now is to install the file

            #

            1. http://repo.open.iona.com/maven2/org/apache/servicemix/camel/org.apache.servicemix.camel.features/4.1.0.0-fuse/org.apache.servicemix.camel.features-4.1.0.0-fuse-features.xml

            #

            1. into the following directory in the ESB kit:

            #

            1. INSTALL_DIR/system/org/apache/servicemix/camel/org.apache.servicemix.camel.features/4.1.0.0-fuse/

            #

            1. Then modify the file and remove the line

            2. <bundle>mvn:org.mortbay.jetty/jetty/6.1.14</bundle>

            #

            1. Just in case, restart the ESB to effect the configuration change.

            #%%%%%%%%%%%%%%%%%%%%%% IMPORTANT - PLEASE READ %%%%%%%%%%%%%%%%%%%%%%

            #osgi/install -s mvn:org.codehaus.jettison/com.springsource.org.codehaus.jettison/1.0.1

            #osgi/install -s mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.locator/1.2.0.2-fuse

            #osgi/install -s mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jsr311-api-0.8/1.2.0.2-fuse

            #osgi/install -s mvn:org.apache.ws.commons.axiom/axiom-api/1.2.7

            #osgi/install -s mvn:org.apache.ws.commons.axiom/axiom-impl/1.2.7

             

            features/install cxf-osgi

            features/install camel-jms

            features/install camel-cxf

             

            #----


            1. FURTHeR bundles

            #----


            1. Other maven dependencies

            osgi/install -s wrap:mvn:org.codehaus.jra/jra/1.0-alpha-4

             

            1. FURTHeR dependencies

            osgi/install -s wrap:mvn:edu.utah.further.core/core-api$Bundle-SymbolicName=further-core-api&Bundle-Version=1.0

            osgi/install -s wrap:mvn:edu.utah.further.core/core-util$Bundle-SymbolicName=further-core-util&Bundle-Version=1.0

             

            1. Main FURTHeR FQE bundles

            osgi/install -s wrap:mvn:edu.utah.further.fqe/fqe-se-simple

            osgi/install -s wrap:mvn:edu.utah.further.fqe/fqe-bc

            osgi/install -s wrap:mvn:edu.utah.further.fqe/fqe-bc-ws

             

            When the bus first loads (even a clean ESB with no data directory), I see 13M of exceptions in the log file:

             

            10:17:51,843 | WARN  | pool-1-thread-1  | FileMonitor                      | x.k

            ernel.filemonitor.FileMonitor  552 | Failed to start bundle: activemq-broker.xml

            . Reason: org.osgi.framework.BundleException: Unresolved constraint in bund

            le 43: package; (package=org.apache.activemq)

            org.osgi.framework.BundleException: Unresolved constraint in bundle 43: package;

            (package=org.apache.activemq)

                    at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3059)

                    at org.apache.felix.framework.Felix.startBundle(Felix.java:1439)

                    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:770)

                    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:751)

                    at org.apache.servicemix.kernel.filemonitor.FileMonitor.refreshPackagesA

            ndStartOrUpdateBundles(FileMonitor.java:549)

                    at org.apache.servicemix.kernel.filemonitor.FileMonitor.onFilesChanged(F

            ileMonitor.java:299)

                    at org.apache.servicemix.kernel.filemonitor.FileMonitor$3$1.run(FileMoni

            tor.java:318)

                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec

            utor.java:886)

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor

            .java:908)

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

             

            I know this is a known issue, but I haven't seen if it is resolved. Since Felix is reporting the problem, maybe that is why "update x" does not work well for me?

             

            Thanks

            Oren

            • 3. Re: osgi/update does not seem to update bundle
              deleted user Newbie

              Hi Oren

              Unfortunately I'm not currently uptodate with these OSGI specific issues, like this one

               

              0:17:51,843 | WARN | pool-1-thread-1 | FileMonitor | x.k

              ernel.filemonitor.FileMonitor 552 | Failed to start bundle: activemq-broker.xml

              43. Reason: org.osgi.framework.BundleException: Unresolved constraint in bund

              le 43: package; (package=org.apache.activemq)

              org.osgi.framework.BundleException: Unresolved constraint in bundle 43: package;

              (package=org.apache.activemq)

              at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3059)

               

               

              hopefully others can help you in resolving them. I'm hoping to get more uptodate once I start fixing one of the CXF JAX-RS in SMX4/JBI issues created recently

              thanks, SErgey

              • 4. Re: osgi/update does not seem to update bundle
                Stan Lewis Novice

                This error:

                 

                Unresolved constraint in bundle 43: package; (package=org.apache.activemq)

                 

                is a known issue, it's because in some cases the container tries to deploy the deploy/activemq-broker.xml file before some of the dependent bundles have been deployed.  Either restarting the ESB or using the work-around mentioned in ESB-759 will sort this out.   I don't think this is the cause of osgi/update not working.  Good to hear though that osgi/refresh does at least update the bundle for you.  Thanks for sending on the info, I'll have to look into this further.

                • 5. Re: osgi/update does not seem to update bundle
                  Oren Livne Novice

                  I followed the ESB-750 workaround but unfortunately the update/refresh and Felix exceptions remain. Here is the latest exception trace:

                   

                  18:12:57,171 | WARN  | FelixStartLevel  | ManagedFeaturesRegistry          | nagement.ManagedFeaturesRegistry  128 | Unable to register managed feature: java.lang.NullPointerException

                  java.lang.NullPointerException

                       at org.apache.servicemix.kernel.gshell.features.management.ManagedFeaturesRegistry.registerInstalled(ManagedFeaturesRegistry.java:125)

                       at org.apache.servicemix.kernel.gshell.features.internal.FeaturesServiceImpl.loadState(FeaturesServiceImpl.java:471)

                       at org.apache.servicemix.kernel.gshell.features.internal.FeaturesServiceImpl.start(FeaturesServiceImpl.java:389)

                       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                       at java.lang.reflect.Method.invoke(Method.java:597)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1414)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1375)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

                       at java.security.AccessController.doPrivileged(Native Method)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

                       at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

                       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

                       at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

                       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

                       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

                       at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)

                       at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

                       at java.security.AccessController.doPrivileged(Native Method)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

                       at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

                       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

                       at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

                       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

                       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

                       at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)

                       at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

                       at java.security.AccessController.doPrivileged(Native Method)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

                       at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

                       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

                       at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

                       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

                       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

                       at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)

                       at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)

                       at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:287)

                       at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:126)

                       at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:479)

                       at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:162)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

                       at java.security.AccessController.doPrivileged(Native Method)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

                       at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:219)

                       at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

                       at java.security.AccessController.doPrivileged(Native Method)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

                       at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:219)

                       at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)

                       at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:287)

                       at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:126)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

                       at java.security.AccessController.doPrivileged(Native Method)

                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

                       at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

                       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

                       at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

                       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

                       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

                       at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)

                       at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)

                       at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:68)

                       at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:343)

                       at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)

                       at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:308)

                       at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:138)

                       at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)

                       at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageTwo(DependencyWaiterApplicationContextExecutor.java:304)

                       at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:246)

                       at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:168)

                       at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:179)

                       at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:759)

                       at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)

                       at org.springframework.osgi.extender.internal.activator.ContextLoaderListener.maybeCreateApplicationContextFor(ContextLoaderListener.java:806)

                       at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$ContextBundleListener.handleEvent(ContextLoaderListener.java:233)

                       at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$BaseListener.bundleChanged(ContextLoaderListener.java:176)

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

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

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

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

                       at org.apache.felix.framework.Felix.startBundle(Felix.java:1517)

                       at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:984)

                       at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:263)

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

                  18:12:57,390 | WARN  | FelixStartLevel  | NamespaceManager                 | nternal.support.NamespaceManager  131 | Bundle activemq-ra (org.apache.activemq.activemq-ra) cannot see class ; ignoring its namespace handlers

                  18:12:57,843 | WARN  | FelixStartLevel  | NamespaceManager                 | nternal.support.NamespaceManager  131 | Bundle xbean-classloader (org.apache.xbean.xbean-classloader) cannot see class ; ignor

                   

                  Thanks so much for your help!

                  • 6. Re: osgi/update does not seem to update bundle
                    Oren Livne Novice

                    The update seems to be working in fuse 4.1.0.2.