Results 1 to 1 of 1

Thread: Required 'bundleContext' property was not set.

  1. #1
    Join Date
    May 2010
    Posts
    5

    Default Required 'bundleContext' property was not set.

    I am also encountering the above error message when running a webapp that uses an <osgi:reference/> element.

    First here is the stack trace:
    at org.springframework.util.Assert.notNull(Assert.jav a:112)
    at org.springframework.osgi.service.importer.support. AbstractOsgiServiceImportFactoryBean.afterProperti esSet(AbstractOsgiServiceImportFactoryBean.java:79 )
    at org.springframework.osgi.service.importer.support. AbstractServiceImporterProxyFactoryBean.afterPrope rtiesSet(AbstractServiceImporterProxyFactoryBean.j ava:52)
    at org.springframework.osgi.service.importer.support. OsgiServiceProxyFactoryBean.afterPropertiesSet(Osg iServiceProxyFactoryBean.java:118)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1460)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1398)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:512)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:450)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 90)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:287 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:189)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:540)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:842)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:416)
    at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:4 43)
    at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:4 59)
    at org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:340 )
    at org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:307)
    at org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:127)
    at javax.servlet.GenericServlet.init(GenericServlet.j ava:212)

    I have configured the "contextClass" parameter in web.xml to the value "com.springsource.server.web.dm.ServerOsgiBundleXm lWebApplicationContext". By debugging I noticed that the BundleContextAwareProcessor processes one instance of the OsgiServiceProxyFactoryBean and sets its bundle context, however multiple instances of OsgiServiceProxyFactoryBean are being created (all with the same bean name) and only one is processed by BundleContextAwareProcessor. One of the other instances is used when the application is executed from the browser.

    Regards
    Neil
    Last edited by njbartlett; Jun 7th, 2010 at 09:53 AM. Reason: reformat stack trace

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
  •