javaosgieclipse-virgoblueprint-osgi

Osgi - Virgo 3.6 - Loading application Context


I am creating a Jar Bundle deployed in Virgo Server 3.6, The Jar Works fine,

      <service ref="pluginManager" interface="com.roshka.osgi.manager.PluginManager" />

Then to test my first Bundle i am creating another Jar Bundle, that is a plugin JAR Bundle. And the the Bundle Plugin works fine, and call the first jar with successfully

To end, i want create a war bundle to consumes the First Jar Bundle, after read the documentation i am add to web.xml, i use a MVC Spring, works fine but can not inject the osgi bean service to call methods of first jar bundle

                <context-param>
                    <param-name>contextClass</param-name>
                        <paramvalue>
                              org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext
                        </param-value>
                </context-param>

          <listener>
        <listener-class>
                  org.springframework.web.context.ContextLoaderListener
                </listener-class>


And create a applicationContext.xml to load a service


        <reference id="pluginManager" interface="com.roshka.osgi.manager.PluginManager" />

I think that, the problem is that the applicationContext.xml has not loaded, and my question what is the wrong in the war project.


Solution

  • Did you try to specify your applicationContext.xml like this:

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>
    

    in your web.xml?