You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by mv...@comcast.net on 2010/08/05 17:06:51 UTC

Managing large Karaf projects with multiple bundles

My project has about 130 different bundles, which appear to need to be deployed in a specific order because of thier dependencies.  The problem is, in an operational scenario where the OSGi container is shut down and restarted, how can I ensure that all 130 bundles come back up in the same order?  On my initial test, after > 14 hours, the suite of bundles were still not availble and there was no way to interact with the command-line.  It just looked like it hung.  To make matters worse (more frustrating), there were absolutely no log errors I could use to pinpoint the problem.  HELP!!! :-) 

Re: Managing large Karaf projects with multiple bundles

Posted by Guo Du <mr...@duguo.org>.
On Fri, Aug 6, 2010 at 11:41 AM, Charles Moulliard <cm...@gmail.com> wrote:
> If you don't want to use bundle start level, which solution do you use when
> you would like to start service or bundles in a specific order ?
It's against OSGi, but you can achieve this by monitor the bundle
installed/started events, only install/start next bundles when some
required bundles installed/started.

Understand it useful when you have hundreds of bundles. You start
bundles group by group, it could detect error earlier and make the
troubleshooting easier.

-Guo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Managing large Karaf projects with multiple bundles

Posted by Marcel Offermans <ma...@luminis.nl>.
I think you are mixing up two things here:

1) the order in which bundles are started
2) the order in which services are started

The point that Felix and Bertrand are making is that these two are not necessarily the same and that you should model your services to depend on the services they need so they will not be started before those are actually available.

If you do not do that, you will run into serious troubles if you ever want to be able to update bundles without having to restart the whole framework. To be more precise, if you depend on bundles to be started in the order you defined using start levels, at best you will have to bring the system down to a start level lower than the one the bundle you are updating has.

Greetings, Marcel

On 9 Aug 2010, at 8:56 , Charles Moulliard wrote:

> As we don't have like in J2EE specification (for servlet) a level that we
> can use to indicate when a service (deployed in a bundle) must be started
> (before or after another), using the bundle start level is the only way that
> we have now to group bundles (in combination with Spring DM or Blueprint)
> and start them in a certain "order. This allows nevertheless to deploy in
> priority platform bundles (= karaf or servicemix bundles), infrastructure
> bundles (like Camel, CXf, ActiveMq) followed by project bundles.
> 
> 
> On Fri, Aug 6, 2010 at 3:26 PM, Bertrand Delacretaz
> <bd...@apache.org>wrote:
> 
>> On Fri, Aug 6, 2010 at 1:13 PM, Felix Meschberger <fm...@gmail.com>
>> wrote:
>>> On 06.08.2010 12:41, Charles Moulliard wrote:
>>>> If you don't want to use bundle start level, which solution do you use
>> when
>>>> you would like to start service or bundles in a specific order ?
>>> 
>>> Point about the start level is, that it is more like an administrative
>>> measure: A system administratore may for whatever reason decide to
>>> assign whatever start levels to whatever bundles....
>> 
>> IMO a good reason is to emulate the unix run levels, where for example
>> level 1 is "single user", so just a management console, level 5 is
>> "web server active", level 10 is "application active" etc. - as you
>> say, for system maintenance and testing purposes.
>> 
>> Although start levels can be used to define bundles start order, I
>> don't think they were meant for that - as Felix says the start order
>> should be irrelevant.
>> 
>> -Bertrand
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Managing large Karaf projects with multiple bundles

Posted by Charles Moulliard <cm...@gmail.com>.
As we don't have like in J2EE specification (for servlet) a level that we
can use to indicate when a service (deployed in a bundle) must be started
(before or after another), using the bundle start level is the only way that
we have now to group bundles (in combination with Spring DM or Blueprint)
and start them in a certain "order. This allows nevertheless to deploy in
priority platform bundles (= karaf or servicemix bundles), infrastructure
bundles (like Camel, CXf, ActiveMq) followed by project bundles.


On Fri, Aug 6, 2010 at 3:26 PM, Bertrand Delacretaz
<bd...@apache.org>wrote:

> On Fri, Aug 6, 2010 at 1:13 PM, Felix Meschberger <fm...@gmail.com>
> wrote:
> > On 06.08.2010 12:41, Charles Moulliard wrote:
> >> If you don't want to use bundle start level, which solution do you use
> when
> >> you would like to start service or bundles in a specific order ?
> >
> > Point about the start level is, that it is more like an administrative
> > measure: A system administratore may for whatever reason decide to
> > assign whatever start levels to whatever bundles....
>
> IMO a good reason is to emulate the unix run levels, where for example
> level 1 is "single user", so just a management console, level 5 is
> "web server active", level 10 is "application active" etc. - as you
> say, for system maintenance and testing purposes.
>
> Although start levels can be used to define bundles start order, I
> don't think they were meant for that - as Felix says the start order
> should be irrelevant.
>
> -Bertrand
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Managing large Karaf projects with multiple bundles

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Fri, Aug 6, 2010 at 1:13 PM, Felix Meschberger <fm...@gmail.com> wrote:
> On 06.08.2010 12:41, Charles Moulliard wrote:
>> If you don't want to use bundle start level, which solution do you use when
>> you would like to start service or bundles in a specific order ?
>
> Point about the start level is, that it is more like an administrative
> measure: A system administratore may for whatever reason decide to
> assign whatever start levels to whatever bundles....

IMO a good reason is to emulate the unix run levels, where for example
level 1 is "single user", so just a management console, level 5 is
"web server active", level 10 is "application active" etc. - as you
say, for system maintenance and testing purposes.

Although start levels can be used to define bundles start order, I
don't think they were meant for that - as Felix says the start order
should be irrelevant.

-Bertrand

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Managing large Karaf projects with multiple bundles

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

On 06.08.2010 12:41, Charles Moulliard wrote:
> If you don't want to use bundle start level, which solution do you use when
> you would like to start service or bundles in a specific order ?

Point about the start level is, that it is more like an administrative
measure: A system administratore may for whatever reason decide to
assign whatever start levels to whatever bundles.

Developers should (some people, me included, say "must") develop their
bundles in a manner that order of deployment/start does not matter at all.

Of course, some functionality (read: services) may not be readily
available when bundles are started in a different order. Again: Bundles
(read: service consumers) must be prepared for services to not be
available (yet).

There is lots of tooling available helping you manage this. Declarative
Services (my favourite ;-) ), Dependency Manager, iPojo, Blueprint, are
just a few.

Regards
Felix

> 
> On Thu, Aug 5, 2010 at 5:52 PM, Bertrand Delacretaz
> <bd...@apache.org>wrote:
> 
>> Hi,
>>
>> On Thu, Aug 5, 2010 at 5:06 PM,  <mv...@comcast.net> wrote:
>>> My project has about 130 different bundles, which appear to need to be
>> deployed in a specific
>>> order because of thier dependencies....
>>
>> Relying on bundles start order sounds bad, OSGi best practices should
>> help avoid that.
>>
>> Using start levels can help you define the order in which your bundles
>> start, but that will make management of your system much more complex
>> than it should be.
>>
>> -Bertrand
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Managing large Karaf projects with multiple bundles

Posted by Charles Moulliard <cm...@gmail.com>.
If you don't want to use bundle start level, which solution do you use when
you would like to start service or bundles in a specific order ?

On Thu, Aug 5, 2010 at 5:52 PM, Bertrand Delacretaz
<bd...@apache.org>wrote:

> Hi,
>
> On Thu, Aug 5, 2010 at 5:06 PM,  <mv...@comcast.net> wrote:
> > My project has about 130 different bundles, which appear to need to be
> deployed in a specific
> > order because of thier dependencies....
>
> Relying on bundles start order sounds bad, OSGi best practices should
> help avoid that.
>
> Using start levels can help you define the order in which your bundles
> start, but that will make management of your system much more complex
> than it should be.
>
> -Bertrand
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Managing large Karaf projects with multiple bundles

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Thu, Aug 5, 2010 at 5:06 PM,  <mv...@comcast.net> wrote:
> My project has about 130 different bundles, which appear to need to be deployed in a specific
> order because of thier dependencies....

Relying on bundles start order sounds bad, OSGi best practices should
help avoid that.

Using start levels can help you define the order in which your bundles
start, but that will make management of your system much more complex
than it should be.

-Bertrand

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Managing large Karaf projects with multiple bundles

Posted by Charles Moulliard <cm...@gmail.com>.
With Karaf 2.0, it is possible using the features provisioning mechanism to
define the bundle start level. This could be helpful for you

http://karaf.apache.org/46-provisioning.html

Kind regards,

Charles Moulliard

Senior Enterprise Architect (J2EE, .NET, SOA)
Apache Camel - Karaf -ServiceMix Committer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Blog : http://cmoulliard.blogspot.com |  Twitter :
http://twitter.com/cmoulliard
Linkedin : http://www.linkedin.com/in/charlesmoulliard | Skype: cmoulliard


On Thu, Aug 5, 2010 at 5:06 PM, <mv...@comcast.net> wrote:

> My project has about 130 different bundles, which appear to need to be
> deployed in a specific order because of thier dependencies.  The problem is,
> in an operational scenario where the OSGi container is shut down and
> restarted, how can I ensure that all 130 bundles come back up in the same
> order?  On my initial test, after > 14 hours, the suite of bundles were
> still not availble and there was no way to interact with the command-line.
> It just looked like it hung.  To make matters worse (more frustrating),
> there were absolutely no log errors I could use to pinpoint the problem.
> HELP!!! :-)
>

Re: Managing large Karaf projects with multiple bundles

Posted by Steven Siebert <sm...@gmail.com>.
I apologize if my answer is phrased more like a question, I'm new to
OSGi and Felix, but I've been doing a lot of reading lately and think
there is an answer for this.  Why not create/use an OSGi Bundle
Repository (OBR)
http://felix.apache.org/site/apache-felix-osgi-bundle-repository.html?

Depending on how you've annotated your manifests already, you may or
may not have to do much more configuration (for example, each bundle
manifest needs Bundle-SymbolicName and Bundle-Version.

Regards,

Steve


On Thu, Aug 5, 2010 at 11:06 AM, <mv...@comcast.net> wrote:
>
> My project has about 130 different bundles, which appear to need to be deployed in a specific order because of thier dependencies.  The problem is, in an operational scenario where the OSGi container is shut down and restarted, how can I ensure that all 130 bundles come back up in the same order?  On my initial test, after > 14 hours, the suite of bundles were still not availble and there was no way to interact with the command-line.  It just looked like it hung.  To make matters worse (more frustrating), there were absolutely no log errors I could use to pinpoint the problem.  HELP!!! :-)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org