Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.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
Osgi 从Spring DM 1.2 Spring 3/KARAF 4.0.10迁移到Blueprint、Spring 5和KARAF 4.2.0_Osgi_Apache Karaf_Aries_Eclipse Gemini - Fatal编程技术网

Osgi 从Spring DM 1.2 Spring 3/KARAF 4.0.10迁移到Blueprint、Spring 5和KARAF 4.2.0

Osgi 从Spring DM 1.2 Spring 3/KARAF 4.0.10迁移到Blueprint、Spring 5和KARAF 4.2.0,osgi,apache-karaf,aries,eclipse-gemini,Osgi,Apache Karaf,Aries,Eclipse Gemini,我使用的是Karaf4.0.10,它将Spring3.1.4安装为启动功能。我们使用springforweb模块(springmvc)和springdm(springosgiweb) 下面是我的示例web.xml。 这就是我的web.xml mvcservlet <servlet> <servlet-name>javorai-api</servlet-name> <servlet-class>org.springframework.web.serv

我使用的是Karaf4.0.10,它将Spring3.1.4安装为启动功能。我们使用springforweb模块(springmvc)和springdm(springosgiweb)

下面是我的示例web.xml。 这就是我的web.xml mvcservlet

<servlet>
<servlet-name>javorai-api</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextClass</param-name>
<param-value>org.springframework.osgi.web.context.support.osgibundlexmlwebapplicationcontext</param-value>
</init-param>

哈沃莱api
org.springframework.web.servlet.DispatcherServlet
上下文类
org.springframework.osgi.web.context.support.osgibundlexmlwebapplicationcontext
当我们将KARAF升级到4.2.0时,spring升级到5.0.4,spring dm不再支持它。它现在已被弃用。基于互联网搜索,我发现了一个建议,那就是用双子座蓝图取代SpringDM。通过将gemini blueprint/IO、Core和extender模块配置为maven依赖项,我下载了它

请您指导web.xml中应该做哪些更改,以便继续使用gemini blueprint替代spring dm


还有没有办法不用blueprint和直接引用web.xml中的SpringJAR文件就能让它工作呢?如果你真的需要使用SpringMVC,你可以使用这个类,它会工作的。但我必须警告你,osgi环境下的spring非常粗糙,双子座经常会弄乱捆绑包的生命周期,除非你应用我为其创建的蓝图捆绑包。

如果我错了,请纠正我,但双子座项目也已经死了很长时间了。如果您希望有一个长期的解决方案,可以选择OSGi或Spring,但不要将两者结合使用。原因:Spring是一块巨石,而OSGi是modularokay,我也尝试过,但似乎org.eclipse.virgo.web.dm在maven上不可用。现在看来这是一个死项目。我找到了一个罐子,可以看到这个罐子也只支持Spring4。KARAF 4.2.0安装了spring 5.0.4版本。你能在这里给我推荐一下替代方案吗?我目前正在OSGI中使用spring MVC,这里有什么选项?我可以完全脱离Spring,使用任何其他技术来支持它吗?您可以仅使用ServerOsgiBundleXmlWebApplicationContext类创建一个简单的jar,它与virgo没有任何依赖关系,只是与gemini和Spring。您使用MVC部件仅仅是为了提供Rest服务还是页面?我也在使用MVC部件进行页面处理。正如您已经建议的,osgi环境下的spring非常粗糙,您可以推荐哪些替代选项?我认为在这种情况下,最好不要使用spring,而是在osgi中尝试其他东西来达到同样的目的。