Results 1 to 5 of 5

Thread: Occational error starting bundles: Required 'bundleContext' property was not set

  1. #1

    Default Occational error starting bundles: Required 'bundleContext' property was not set

    It seems to come on quite randomly, but once it starts throwing those errors, it will consistently keep throwing them. I have managed to get it working again by cleaning out the work + stage folders and doing a clean deploy from eclipse, but it keeps happening. I am using springsource dm server 1.0.1 RELEASE. It always happens on bundle.D, which imports packages from bundle.B and references services from bundle.C.

    Following is the exception:

    Code:
    [2009-01-26 15:47:54.971]  Connection(2)-127.0.0.1 <SPDE0010I> Deployment of 'bundle.B' version '1' completed.
    [2009-01-26 15:47:56.328]  Connection(2)-127.0.0.1 <SPDE0010I> Deployment of 'bundle.C' version '1' completed.
    [2009-01-26 15:47:57.892] server-dm-13             <SPDE0020E> Application context creation failure for bundle 'bundle.D'.
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'osgiProcessors#org.springframework.osgi.service.importer.support.OsgiServiceCollectionProxyFactoryBean#0': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Required 'bundleContext' property was not set.
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
    	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.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
    	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:288)
    	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:145)
    	at com.springsource.server.kernel.dm.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
    	at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.IllegalArgumentException: Required 'bundleContext' property was not set.
    	at org.springframework.util.Assert.notNull(Assert.java:112)
    	at org.springframework.osgi.service.importer.support.AbstractOsgiServiceImportFactoryBean.afterPropertiesSet(AbstractOsgiServiceImportFactoryBean.java:79)
    	at org.springframework.osgi.service.importer.support.AbstractServiceImporterProxyFactoryBean.afterPropertiesSet(AbstractServiceImporterProxyFactoryBean.java:48)
    	at org.springframework.osgi.service.importer.support.OsgiServiceCollectionProxyFactoryBean.afterPropertiesSet(OsgiServiceCollectionProxyFactoryBean.java:163)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
    	... 17 more
    
    [2009-01-26 15:47:57.901]  Connection(2)-127.0.0.1 <SPDE0011E> Deployment of 'bundle.D' version '1' failed.
    Thank you.

  2. #2
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    The most likely cause is that your application and Spring DM are bound to distinct versions of the package containing the BundleContextAware interface.

    Have you added a version of Spring or Spring DM after installing dm Server?

    If not, then perhaps you could raise a JIRA and attach a trace.log which will give us more context for diagnosing the problem.
    Glyn Normington
    SpringSource

  3. #3

    Default

    Thank you for your quick reply. That certainly is the case, I did install a new version of spring using ivy. Though this does raise another issue I have been trying to figure out: I have org.springframework.osgi.core-1.1.2.B.jar in my bundles/ext directory, and (because I use an ivy cache for my usr bundles) I have org.springframework.osgi.core-1.1.1.A.jar in my bundles/usr directory. Problem I have been having is that even though two other bundles' manifests either don't specify a version, or specify a version which includes both, they can often each pick a seperate version of org.springframework.osgi.core.

    bundle.A imports org.springframework.osgi.core;version="[1.0.0,2.0.0)"
    bundle.B imports org.springframework.osgi.core;version="[1.0.0,2.0.0)"

    bundle.A actually imports 1.1.2.B
    bundle.B actually imports 1.1.1.A

    Looking at just the telnet output, I'm guessing that bundle.A installs both versions, but uses the highest, and then bundle.B just grabs the first one.

  4. #4
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    Bundle.A and Bundle.B presumably wire to distinct versions of org.springframework.osgi.core because of their other wiring constraints and the "uses" constraints between the various packages.

    I'm a little surprised that you are importing Spring DM packages at all. You don't need to do this simply to use Spring DM.

    Please note that in v1 of dm Server it is only possible to run a single version of Spring DM at any given time and that is the version which will try to create application contexts for any "Spring DM powered" bundles (those with the relevant XML files in the META-INF/spring directory). If the application is wired to a different version of Spring (or Spring DM should that really be necessary) than the currently running Spring DM, then many and varied problems can arise.

    I would recommend that you try to ensure there is only one version of Spring DM installed and started in your system.
    Glyn Normington
    SpringSource

  5. #5
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    Glyn Normington
    SpringSource

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •