3
votes

I had some problems with my server so i built my portlets and tested them locally on a liferay portlet container. I used portlet 2.0 API for Java and JSR 286 standards. The portlets are built using Spring framework and they work on my local machine.

My question is how do I convert an pack a Spring based portlet, that I have, to a OSGI bundle? What do I nedd to adjust in my current portlet to fit the need's of a OSGI bundle?

I am using eclipse to develope portlets and ant to pack them to a war file and don't know how to use ant to pack it to a osgi bundle jar.

Thank you!

1
May I ask on which app server you need the plugin to be an osgi bundle? I ask because I'm working on the osgi support for liferay and have some packaging issues worked out already, but it's a little specific.Ray
I am working on a custom made server, based on pluto i think. I did not made it i just develop bundles for it, so my info about the server is limiteddrvido

1 Answers

0
votes

You need to break down your application and decide how you make use of the OSGi module layer. For an example one of the bundles exporting API (JRS-APIs) and other importing them.

If you are going in that path, initially you will face troubles such as ClassNotFounds and ClassCastsException. But Once you get over that period, you will be able to make use of cool features such as OSGi services/multiple versions/etc.

Eclipse provides great tooling support for OSGi bundle development. IMHO you dont have to run ant tasks. If you are using maven, then you can use felix-bundle plugin to create your bundles.

The other option is to create a one huge bundle that has all the dependencies - inline. It will work, but then again you are not using the power of OSGi. :)

HTH.