Spring component scan in OSGi does not find anything

Using the Spring -Context MANIFEST definition , I am trying to make component-scanannotated beans to search for packages for Spring. My Spring XML configuration looks something like this:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">

    <!-- Scans the classpath of this application for @Components to deploy as 
        beans -->
    <context:component-scan
        base-package="com.some.other.module.one,com.another.module.two" />

    <context:annotation-config />
....

</beans>

In MANIFEST, I import packages containing classes with Spring annotations. However, when I check ApplicationContext, it does not have any of the annotated beans in it.

, , , , . , Spring. , Spring , -? , , . , ?

Edit

, Spring , , . :

  • Spring 3 @Configuration bean.
  • XML , @Configuration bean.
  • @Configuration bean @Import .
  • Require-Bundle MANIFEST, , .
+5
1

OSGi - , . Spring ApplicationContext, Spring, . - .

, , ApplicationContext. ApplicationContexts beans OSGi Service Registry. beans ApplicationContexts, .

, Spring , beans. Spring / beans OSGi.

: 8. OSGi Spring

+7

All Articles