Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for an OSGi with Spring (specifically Spring MVC) tutorial [closed]

I'm new to OSGi but pretty familiar with Spring. I'm at a new company who uses OSGi, but knows nothing about Spring. I'd like to learn how Spring can be integrated in with OSGi, specifically for serving up web pages. I've Googled the web for days and its hard to find a full on tutorial to get me started. I only find articles on using OSGi and Spring-DM. Being that Spring-DM is now integrated into OSGi as blueprint, these articles are of no use.

Can anyone point me to a tutorial for creating an OSGi project using Spring (IoC, MVC, etc.), and preferably Maven for dependency management.

Thank you.

like image 731
loesak Avatar asked Oct 11 '12 05:10

loesak


3 Answers

You can find immense help from the Spring Source blog..

Particularly you can try these links: -

  • http://blog.springsource.org/2007/04/05/so-whats-the-deal-with-spring-osgi/
  • http://blog.springsource.org/2008/05/01/completing-the-picture-spring-osgi-and-the-springsource-application-platform/
  • http://lsd.luminis.eu/getting-started-with-spring-osgi/
  • http://www.javaworld.com/javaworld/jw-04-2008/jw-04-osgi2.html
like image 125
Rohit Jain Avatar answered Nov 03 '22 00:11

Rohit Jain


You can use spring-dm to use spring in OSGi but honestly I do not recommend it. Spring dm tries to be as compatible to pure spring as possible and so introduces a lot of issues when in OSGi. Additionally springsource seems to hava abandoned work on spring dm so it seems like a dead track to me. I have met a lot of people who had the impression that OSGi is complicated and has a lot of classloading issues. Many of these problems originated in spring dm.

Instead I recommend to use blueprint which is similar enough to spring that you should have an easy time getting started with it. I have a series of articles about blueprint that show how to use it together with maven and Apache Karaf. One thing that is a bit more complicated in OSGi is testing as you can not easily do out of container tests. There is a great framework for OSGi testing named pax exam though. I plan to do an article about testing in Apache Karaf soon.

See: http://www.liquid-reality.de/display/liquid/Karaf+Tutorials

Till now I only used aries blueprint. There is also gemini from spring source but I have no real expereince with it.

like image 3
Christian Schneider Avatar answered Nov 02 '22 22:11

Christian Schneider


The book Spring Dynamic Modules in Action really helps you to get on track with OSGi in general and Spring DM specifically. I really can recommend it!

like image 1
James Avatar answered Nov 02 '22 22:11

James