Migration from Spring DM 1.2 Spring 3 / KARAF 4.0.10 to Blueprint, Spring 5 and KARAF 4.2.0

646 views Asked by At

I was using KARAF 4.0.10 which installs spring 3.1.4 as boot feature. We were using spring for web module (spring-mvc) with spring-dm (spring-osgi-web).

Here is my example web.xml. That is my web.xml Mvc Servlet

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

As we upgraded KARAF to 4.2.0, spring is upgraded to 5.0.4 and spring-dm does not support it anymore. it is deprecated now. based on internet search, I found the suggestion to move on to gemini blueprint as replacement of spring-dm. I have downloaded gemini-blueprint/IO, Core and extender module by configuring it as maven dependency.

Can you please guide on what should be changed in web.xml to move on to gemini blueprint as replacement of spring-dm?

Also is there any way to get it working without using blueprint and directly referring spring jar files in web.xml

1

There are 1 answers

7
Cλstor On

If you really really really need to use Spring MVC, you can use the ServerOsgiBundleXmlWebApplicationContext class, it will work. But i must warn you, spring under an osgi environment is quite hackish, gemini will often mess up with the bundles lifecycle and it will break aries-blueprint bundles unless you apply a patch i've created for it.