users@glassfish.java.net

Re: OBR in Glassfish v3?

From: Rickard Öberg <rickardoberg_at_gmail.com>
Date: Fri, 21 May 2010 14:54:05 +0800

Hi!

On 2010-05-21 14.39, Sanjeeb Sahoo wrote:
> I acknowledge absence of proper documentation about OSGi features in
> GlassFish. I don't see our docs to change either before 3.1 release, so
> in the mean while, I have created a Wiki page [1] to capture whatever
> information available. Take a look at it and send your comments. Keep in
> mind that I have just recently created the page, so it does not have all
> the info I want it to have. I certainly want to add an FAQ and some
> documentation in the form of a guide.

Ok, cool, thanks!

And just to let you know, the OSGi features are absolutely awesome, even
if undocumented. That I could take my WAR file and just drop it into
autodeploy, have it deployed, and then look up other bundles to do the
actual work, is amazing. I love it!

> Coming back to use of OBR, it is one of the things we would like to have
> a better story about in 3.1 release. /Can you please tell us what kind
> of OBR related feature you are looking for in glassfish? /

The main issue I'm seeing is that although I barely started I already
have 5 bundles, and that's only because I'm cheating and put all of my
dependencies (30+ libraries) into one bundle. If I were to do this
"properly" the number of bundles would explode.

For myself I can copy/paste jar files into /autodeploy. But how do I
install this in a customers production environment? Even worse, how do I
do upgrades, where I need to put in new bundles and remove the old ones?
It seems like it can easily become a mess. Especially considering that
/autodeploy contains both my own bundles as well as 3rd party bundles
that plugin to my application, so I can't just wipe /autodeploy when a
new version comes along.

This is the problem I'm facing, and can't find a good answer to it. In
the old model I put all my stuff into one war file, and
installing/upgrading that was easy. How do I do it when my app is
splashed out into lots of bundles? Any ideas from the real world are
welcome! (And no, clever use of the shell is not practical)

> To use OBR in current glassfish, please download and install OBR bundles:
>
> cd .../glassfish/domains/domain1/autodeploy/bundles/
> wget http://www.reverse.net/pub/apache/felix/org.osgi.service.obr-1.0.2.jar
> wget
> http://www.reverse.net/pub/apache/felix/org.apache.felix.bundlerepository-1.6.2.jar

Cool, I'll try it out!

> I am assuming you have your own repo which you add using "obr add-url"
> command.

So, what would be most interesting is if I can tell customers to install
Glassfish, and then use the above to get the actual application. That
seems to work for installation, but what about upgrades? How does "old"
bundles get removed?

Is anyone using this stuff *in production* yet, with these kinds of
issues coming up, or is it pilot/development mode only for most people?

/Rickard