Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Investigating OSGi and Virgo(Call for help and documentation)
Investigating OSGi and Virgo [message #890161] Thu, 21 June 2012 10:11 Go to next message
ronald Mising name is currently offline ronald Mising nameFriend
Messages: 52
Registered: July 2009
Member
Hi all,

After 2 years of PHP work, I finally got a new Java project and hopefully I'm able to do that using OSGi.
(Having done a lot of java before that)

I'm sorry to say that I'm totally confused when looking at all the OSGi documentation and examples. It's really hard to get an overview of all the libraries, versions and the goals for every tool and library out there.

I'm looking at OSGi (and Virgo Smile because I believe it promises development of a (web) application that consists of small maintainable bundles that can be hot-swapped. (I really like that, for not having to upload and restart a Tomcat app in the middle of the night)
I feel OSGi is the way to go. But getting on that train is very, very hard.

All I can find are small examples of how to register a service and other small details, and the benefits of OSGi. I do understand the concepts, but are there any more real-world examples out there?
The Virgo site only mentions the Green-Pages example (Which is unavailable, see the docs at http://www.eclipse.org/virgo/documentation/greenpages-documentation-2.5.0.RELEASE/docs/html/ch02s02.html and the download location http://eclipse.org/virgo/download/ where there's no mention of the example green-pages download).

Virgo comes with some Spring bundles I believe? What is the relation to the Blueprint/Aries project? Is Blueprint ment to replace the Spring functionality? Blueprint calls itself a 'container'. Why? Isn't it just a kind of dependency injection library for OSGi services?
Somewhere I read it follows the 4.2 OSGi spec. Does that mean Blueprint is included in the latest Virgo? Should I use that instead of Spring?
Of course, if Blueprint is an external library, this all shouldn't be Virgo's concern, but it would be really, really nice if the Virgo documentation says something like "If you want this functionality, Blueprint is an option, see ..." or "These and these libraries solve this problem" or "These libraries make it easier to write this 'standard' code as '...'".
If Blueprint is replacing Spring, it would be nice if the Greep-Pages example would be updated.

What is the relation to the Gemini project (if any)? There's a description on http://www.eclipse.org/gemini/ but after having read that description several times, I really have no clue what Gemini is about. Again, not Virgo's problem, but very confusing.

Are there any overview articles that show a decent (real-world) application design using Virgo and describe what the role of (possible) external libraries are?

Another important question for me is:
If splitting up an application in multiple bundles, I imagine a bundle may add it's own model entities. I'd love to have an app where I could make some small modifications to an entity (say adding a field) and then hot-swap that bundle. But I find it hard to get my mind around the implementation of a persistence solution with multiple bundles 'donating' model entities and running multiple versions of the model at the same time (temporarily). Are there any examples for this scenario?
Is this possible at all or is it 'best practice' to use a single 'core' bundle with the complete model/persistence implementation?

It would be so great if one could download one of several pre-configured solutions, and have an up-to-date manual that describe the steps to go from there.
(Solutions could be Hibernate/openJPA/EclipseLink/Spring/Blueprint/ configured, and containing pre-defined bundles for different application design.

(See the getting started from the SilverStripe CMS for example: http://www.silverstripe.org/getting-started/ and http://doc.silverstripe.org/framework/en/tutorials/ )

All in all, I'd love to get on the OSGi train using Virgo. Please help me (and possibly others) jump!



Re: Investigating OSGi and Virgo [message #890163 is a reply to message #890161] Thu, 21 June 2012 10:45 Go to previous messageGo to next message
Chris Frost is currently offline Chris FrostFriend
Messages: 230
Registered: January 2010
Location: Southampton, England
Senior Member

Hi,

You can find the Greenpages sample for download here, http://eclipse.org/virgo/samples/

So, Blueprint is a specification from the OSGi alliance to support dependency injection for OSGi. There are two implementations of this specification, one from Aries and Gemini Blueprint from Eclipse. It is not a replacement for Spring, in fact it works very nicely with it. Gemini Blueprint is actually built on top of Spring and allows Spring beans and OSGi services to work together very nicely. The current release of Virgo includes something called Spring DM, this is the project that was donated to Eclipse and became the Gemini Blueprint project. Virgo 3.5.0 is due out in a month or so and will be upgraded to Gemini Blueprint.

Their are quite a few enterprise specifications from the OSGi alliance that support different features, such as JNDI, databases/persistence, web apps, JMX etc... The Gemini project contains a collection of implementations of those specs. Gemini Web is already available with Virgo as the Tomcat packaging. Gemini Web provideds OSGi web application support and uses Tomcat to do this. Gemini Management and Gemini Blueprint will be included in the next release of Virgo and the other project in Gemini and be deployed on top of the Virgo Kernel if you wish to use their functionality.

I'm afraid I can't answer the questions about persistence as it's outside my area of knowledge, I'm a Virgo committer and the Gemini Management lead. Some of the other Virgo committers are more familiar with the persistance side of things so hopefully someone will answer these questions. The Greenpages sample contains all the code and uses JPA I think so might help you out a little.

Thanks, Chris.


------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
Re: Investigating OSGi and Virgo [message #890167 is a reply to message #890163] Thu, 21 June 2012 11:00 Go to previous messageGo to next message
ronald Mising name is currently offline ronald Mising nameFriend
Messages: 52
Registered: July 2009
Member
Hi Chris,

Thank you for your quick reply and excellent explanation.
This is exactly the kind over overview information I was looking for to give these names a place in the OSGi landscape.

I'll have a look at the Greenpages sample, and I ordered the book 'OSGi in Action' to get me started.

Ronald
Re: Investigating OSGi and Virgo [message #890184 is a reply to message #890167] Thu, 21 June 2012 11:53 Go to previous messageGo to next message
Chris Frost is currently offline Chris FrostFriend
Messages: 230
Registered: January 2010
Location: Southampton, England
Senior Member

Hi,

That's great, thanks. You are right though that the landing pages for Gemini could be a little better.

Chris.


------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
Re: Investigating OSGi and Virgo [message #1007832 is a reply to message #890184] Thu, 07 February 2013 16:52 Go to previous messageGo to next message
Sönke Nommensen is currently offline Sönke NommensenFriend
Messages: 1
Registered: February 2013
Junior Member
Hi all,

I am also investigating OSGi and Virgo. As Ronald pointed out, it would be great to be able to have a modular system and hot-swap software-modules using a management console.

I am working on a project which is built with Gradle and uses Spring + JPA + Hibernate (4.1.5) libraries. I am also using some other "standard" 3rd party libraries, e.g.
- slf4j + log4j for Logging,
- Jackson for JSON mapping and
- Dozer for Java bean to bean mapping.

In my project I have some modules which are deployed as web applications (war-files). Currently, I am using a Tomcat 7 to run them using the deploy/undeploy mechanism as a replacement for lifecycle management. These web applications (my "modules") talk to each other via HTTP (RESTful APIs).

I have some basic questions on the topic of migrating this project to OSGi and Virgo:

1) Assuming all my modules are OSGi-fied: Will there be any advantages if I switch from RESTful communication between my modules to OSGi-Service-based communication?

2) I want to use Spring; Is it still possible to choose between the Spring-way of exporting OSGi services (e.g. via spring-osgi-context.xml with "beans"-namespace) and the Blueprint specification style (blueprint.xml with the "blueprint"-namespace)? Will the latter also work with Apache Aries?

3) Do I have to bundle (e.g. using bundlor) every 3rd party dependency manually if I cannot find the version I need/want in the SpringSource Enterprise Bundle Repository?

4) Is it true, that it is not straightforward to OSGi-fy the Hibernate libraries?

5) Do you have any experience with the Gradle OSGi plugin?
Do I have to duplicate my dependency management effort, i.e. do I have to manage dependencies for the build using Gradle (build.gradle) and explicitly manage dependencies for OSGi (MANIFEST.MF) or is it properly generated by the plugin?

6) From your experience, would it be easier just to use
- Maven instead of Gradle and
- EclipseLink/OpenJPA instead of Hibernate (I read about some class-loading issues with Hibernate) in the "OSGi-world"?

Any comments/suggestions/hints are highly appreciated Smile

Regards,
Sönke
Re: Investigating OSGi and Virgo [message #1007941 is a reply to message #1007832] Fri, 08 February 2013 11:01 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Sönke Nommensen wrote on Thu, 07 February 2013 16:52
Hi all,

I am also investigating OSGi and Virgo. As Ronald pointed out, it would be great to be able to have a modular system and hot-swap software-modules using a management console.

I am working on a project which is built with Gradle and uses Spring + JPA + Hibernate (4.1.5) libraries. I am also using some other "standard" 3rd party libraries, e.g.
- slf4j + log4j for Logging,
- Jackson for JSON mapping and
- Dozer for Java bean to bean mapping.

In my project I have some modules which are deployed as web applications (war-files). Currently, I am using a Tomcat 7 to run them using the deploy/undeploy mechanism as a replacement for lifecycle management. These web applications (my "modules") talk to each other via HTTP (RESTful APIs).

I have some basic questions on the topic of migrating this project to OSGi and Virgo:

1) Assuming all my modules are OSGi-fied: Will there be any advantages if I switch from RESTful communication between my modules to OSGi-Service-based communication?

Services are local, so avoid the overhead of a remote call. Also services appear in the service registry which can be useful for debugging etc. Generally services are far more usable than a RESTful API for local bundle->bundle calls.
Quote:


2) I want to use Spring; Is it still possible to choose between the Spring-way of exporting OSGi services (e.g. via spring-osgi-context.xml with "beans"-namespace) and the Blueprint specification style (blueprint.xml with the "blueprint"-namespace)? Will the latter also work with Apache Aries?

Yes, Virgo supports either namespace. If you need to mix other Spring namespaces with Blueprint, you have to make a Spring namespace the default one in your application context XML. Blueprint is a standard which is supported by Apache Aries.
Quote:


3) Do I have to bundle (e.g. using bundlor) every 3rd party dependency manually if I cannot find the version I need/want in the SpringSource Enterprise Bundle Repository?

Yes, unless you add a 3rd party JAR to the bundle classpath of one of your bundles. In general, we'd recommend converting to a bundle and then contributing a patch to the upstream project so that they add bundle manifests in future. You should also be aware of the Eclipse EBR project proposal as a community way of sharing such 3rd party bundle templates.
Quote:


4) Is it true, that it is not straightforward to OSGi-fy the Hibernate libraries?

Not sure, but you can use the SpringSource EBR templates as a starting point. They are available on github - see the Eclipse EBR project proposal for a link.
Quote:


5) Do you have any experience with the Gradle OSGi plugin?

Sorry, but no.
Quote:

Do I have to duplicate my dependency management effort, i.e. do I have to manage dependencies for the build using Gradle (build.gradle) and explicitly manage dependencies for OSGi (MANIFEST.MF) or is it properly generated by the plugin?

6) From your experience, would it be easier just to use
- Maven instead of Gradle and
- EclipseLink/OpenJPA instead of Hibernate (I read about some class-loading issues with Hibernate) in the "OSGi-world"?[

I'll leave that for others to comment as I don't have much direct experience of these.
Quote:


Any comments/suggestions/hints are highly appreciated Smile

Regards,
Sönke
Previous Topic:How to get EclipseRT/Virgo option in preferences>server>runtime environments?
Next Topic:Inconvenient wiring diagrams in the admin console.
Goto Forum:
  


Current Time: Thu Mar 28 19:05:06 GMT 2024

Powered by FUDForum. Page generated in 0.01719 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top