Sunday, October 10, 2010

First hops on Eclipse Virgo

My server has alwas been a monolith with an embedded jetty, mostly configured with spring and a whole bunch of libraries, hibernate, jackrabbit, embedded derby, jasperreports and so on. tons of jars to handle.

For a long time I wished I had chosen OSGi from the beginning, but now came the new hibernate search release that depends on a late lucene version that will be supported by jackrabbit sometime but not now. So no time to wait, OSGi I'm coming. Sick of the jar hell I thought about setting up my own OSGi runtime with equinox and jetty, but why build your own when there is virgo (aka Spring dm Server) available.

So as always after weeks of thinking, making migration plans for the existing server installations in my head, I downloaded virgo on friday night for the first time. I tried the sample to get at least a grip and started to build some library bundles (tried to keep it simple, so mostly large bundles) and copied my sources into some new folders that would be easy to kick if I won't succeed.

First I had to step back on Galilieo, as the Spring Tools Suite builds for Helios gave me the hell of errors and error dialogs popping all the way up. Back on Galilieo I found that I have to get a milestone build of the tools suit to get support for virgo. Getting used to the tooling... The Spring tools hold the Bundle Manifest in the src folder, which is a pain as i have to share one bundle with my RCP client the as used from PDE tooling has META-INF in the project root. Some folks already complained about that. Its really a pain.

Now I could get used to develop the server on Galileo, what means I have to do client development in a different eclipse instance as I depend on 3.6 for the p2 hell of changes that have been going on.

After about 20 aching hours of fixing import and export bundle headers and a truly sleepless night I saw Virgo at least trying to launch my server.

Now I am still fighting to run hibernate. I had to make some hacks on virgos manifests to install jpa2 and I had to install spring 3.0.4 as 3.0.0 that comes with virgo has some bugs regarding JPA2 and hibernate. I opened some forum threads today and I hope that I can get some useful input on classloading issues.

I see some light today.


Glyn said...

How are you getting on with Virgo?

Thomas Kratz said...

It's getting better :) My server has been a monolith with a classic main() before, so I had to make some refactorings (still some issues open) but yesterday I saw the whole infrastructure start for the first time successfully. I still fight with the web bundle, although I followed (at least tried to) the spec it doesn't work by now, but I ran out of time yesterday. Will look at this at the weekend. The web bundle is a simple layer that exposes my services through spring httpinvoker (so no code in it at all), I need the for backward compatibilit, elsewise I would try osgi remoting.

I wondered why I have to import certain packages (javax.sql, etc) that took my quite a while to fix all those dependencies in my bunch of libraries)

Also from time to time I see an exception on virgo (M6) startup when a listFiles (don't have the trace at hand) failes on deployment of one of the apps delivered with virgo (running on windows 7)

And STS tooling even fails to deploy from time to time too, seems that the bundles are not readily deployed when virgo tries to start the plan.

Using Mapstruct with Protobuf3