Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/325.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Osgi-Virgo 3.6-加载应用程序上下文 步骤1根束_Java_Osgi_Eclipse Virgo_Blueprint Osgi - Fatal编程技术网

Java Osgi-Virgo 3.6-加载应用程序上下文 步骤1根束

Java Osgi-Virgo 3.6-加载应用程序上下文 步骤1根束,java,osgi,eclipse-virgo,blueprint-osgi,Java,Osgi,Eclipse Virgo,Blueprint Osgi,我正在创建一个部署在Virgo Server 3.6中的Jar包,Jar运行良好 <service ref="pluginManager" interface="com.roshka.osgi.manager.PluginManager" /> 步骤2插件Jar包 然后为了测试我的第一个包,我创建了另一个Jar包,这是一个插件Jar包。Bundle插件工作正常,并成功调用第一个jar 步骤3 Web插件Jar包 最后,我想创建一个war包来使用第一个Jar包

我正在创建一个部署在Virgo Server 3.6中的Jar包,Jar运行良好

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

  • 步骤2插件Jar包
然后为了测试我的第一个包,我创建了另一个Jar包,这是一个插件Jar包。Bundle插件工作正常,并成功调用第一个jar

  • 步骤3 Web插件Jar包
最后,我想创建一个war包来使用第一个Jar包,在阅读了添加到web.xml的文档之后,我使用了一个MVC Spring,工作正常,但无法注入osgi bean服务来调用第一个Jar包的方法

                <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" />

上下文类
org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext
org.springframework.web.context.ContextLoaderListener
并创建applicationContext.xml以加载服务

我认为,问题是applicationContext.xml没有加载,我的问题是war项目出了什么问题

您是否尝试像这样指定applicationContext.xml:

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

上下文配置位置
/WEB-INF/applicationContext.xml
在web.xml中