Skip to main content

OBR in Glassfish v3?

5 replies [Last post]
Anonymous

Hi,

I've started to use OSGi in Glassfish v3, and although there is veeery
little information available on it, I've gotten it to work decently in
development.

But, for actual deployment it would be nice to have something like OBR
working. The Felix docs says that it has OBR support, and the Glassfish
features page mention it, but when I use the shell in Glassfish there
are no OBR commands available.

What am I missing? Do I have to do something to enable it? Do I have to
run some bundle to get it to work?

thanks, Rickard

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Rickard Öberg

On 2010-05-21 21.53, Sanjeeb Sahoo wrote:
> If you think having a separate autodeploy directory for your app is
> going make things easier, then that's very easy to setup. I recently
> answered a user's query in this forum with the steps to do it. In fact,
> you can have as many such directories as you like. The steps to do it
> would be to add a simple one line config file. Just browse the forum for
> last one week, you will find the steps to do it.

Thanks, that sounds like a very practical solution! Then I could have
one for my product, and another for plugins to my product. Perfect!

>> 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?
> I am not sure if anyone has started to use it in production yet. I know
> some are using it though.

Ok, thanks, good to know.

regards, Rickard

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Sanjeeb Sahoo

Hi Rickard,

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.

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? /

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.bundlerepositor...

From the server log you can see that these two bundles automatically
get started.

Once they are started, the bundlerepository bundle adds obr commands to
Felix shell:

telnet localhost 6666
-> obr help

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

You can also use the obr feature of OSGi web console. To use web console
[3], you need to download and install osgi-http service implementation
as well as the web console:
cd .../glassfish/domains/domain1/autodeploy/bundles/
// replace ${glassfish-version} with 3.0 or 3.0.1-SNAPSHOT or
3.1-SNAPSHOT, etc depending on your current glassfish version.
wget
http://download.java.net/maven/glassfish/org/glassfish/osgi-http/${glassfish-version}/osgi-http.jar

wget
http://www.devlib.org/apache/felix/org.apache.felix.webconsole-3.0.0.jar
open localhost:8080/osgi/system/console

The username and password is admin/admin. If you use v3, you may be
prompted for username/password multiple times because of a bug, but
eventually after two or three prompts it succeeds. This bug has been
fixed in 3.0.1 or 3.1 builds.

We are soon going to have a web console update centre package for 3.1,
so you can download and install it from within glassfish admin console.

Thanks,
Sahoo

[1] http://wiki.glassfish.java.net/Wiki.jsp?page=OSGi
[2] http://wiki.glassfish.java.net/Wiki.jsp?page=BlogsGfOsgi
[3]
http://weblogs.java.net/blog/ss141213/archive/2009/05/using_felix_web.html
Rickard Öberg wrote:
> Hi,
>
> I've started to use OSGi in Glassfish v3, and although there is veeery
> little information available on it, I've gotten it to work decently in
> development.
>
> But, for actual deployment it would be nice to have something like OBR
> working. The Felix docs says that it has OBR support, and the
> Glassfish features page mention it, but when I use the shell in
> Glassfish there are no OBR commands available.
>
> What am I missing? Do I have to do something to enable it? Do I have
> to run some bundle to get it to work?
>
> thanks, Rickard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Rickard Öberg

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.bundlerepositor...

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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Sanjeeb Sahoo

Rickard Öberg wrote:
> 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!
Glad to know this.
>
>> 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)
>
If you think having a separate autodeploy directory for your app is
going make things easier, then that's very easy to setup. I recently
answered a user's query in this forum with the steps to do it. In fact,
you can have as many such directories as you like. The steps to do it
would be to add a simple one line config file. Just browse the forum for
last one week, you will find the steps to do it.
>> 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.bundlerepositor...
>>
>
> 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?
I am not an OBR expert. I am hoping Richard Hall would step in and
provide some tips here.
>
> 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?
I am not sure if anyone has started to use it in production yet. I know
some are using it though.

Thanks,
Sahoo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Richard S. Hall

On 5/21/10 9:53, Sanjeeb Sahoo wrote:
> Rickard Öberg wrote:
>> 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!
> Glad to know this.
>>
>>> 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)
>>
> If you think having a separate autodeploy directory for your app is
> going make things easier, then that's very easy to setup. I recently
> answered a user's query in this forum with the steps to do it. In
> fact, you can have as many such directories as you like. The steps to
> do it would be to add a simple one line config file. Just browse the
> forum for last one week, you will find the steps to do it.
>>> 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.bundlerepositor...
>>>
>>
>> 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?
> I am not an OBR expert. I am hoping Richard Hall would step in and
> provide some tips here.

Keep in mind, OBR is not a full provisioning system and you will likely
need to implement something yourself or use another system on top of
OBR, like Apache Ace.

However, for simple updates, OBR does allow you to deploy newer versions
and it will attempt to update corresponding bundles as necessary. So,
for example, if you have foo v1 deployed and ask OBR to deploy foo v2,
it should attempt to upgrade the existing bundle if possible.

-> richard

>>
>> 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?
> I am not sure if anyone has started to use it in production yet. I
> know some are using it though.
>
> Thanks,
> Sahoo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net