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.
You can find immense help from the Spring Source blog..
Particularly you can try these links: -
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.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With