You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by jaredmac <jm...@mathworks.com> on 2008/07/16 23:41:52 UTC

Re: Wait for services to be fully registered?


Richard S. Hall wrote:
> 
> However, if you really want to make sure everything starts before your 
> GUI, you can put all of your service bundles in a lower start level than 
> your GUI bundle; thus, by the time the GUI bundle starts, then all your 
> services will be available.
> 

Just following up on this. I want to do something like:

Bundle-Name: Blah
Bundle-SymbolicName: org.blah
Bundle-Start-Level: 5

in the Manifest. Is that possible? I see the Java API for it but no more
dynamic approach.

Thanks!
Jared
-- 
View this message in context: http://www.nabble.com/Wait-for-services-to-be-fully-registered--tp17741822p18497267.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


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


Re: EventAdmin hangs when starting felix

Posted by pa...@theokorigroup.com.
I'm using Felix 1.0.4 on a 64 bit Linux machine running Ubuntu 8.04. I'm having trouble generating a thread dump. When I hit Ctrl-\, the process simply exists without a stack trace. Same when I kill it from another terminal window. I have likewise had no luck using jstacktrace. Looking around on the web, it seems this may be Ubuntu issue. I'll keep trying.

--
Parker Abercrombie <FI...@gmail.com>


On Wed, 23 Jul 2008 09:50:37 +0200, "Karl Pauls" <ka...@gmail.com> wrote:
> Can you provide me with a little bit more information and a thread
> dump please? What version of Felix are you using and what OS are you
> running? You can create a thread dump as described at
> http://java.sun.com/developer/technicalArticles/Programming/Stacktrace/
> 
> regards,
> 
> Karl
> 
> On Wed, Jul 23, 2008 at 3:24 AM,  <pa...@theokorigroup.com>
> wrote:
>> When I start Felix, sometimes the process hangs. It doesn't happen every
> time. Maybe a race condition somewhere?
>>
>> This is my output, up to where things lock up:
>>
>> Welcome to Felix.
>> =================
>>
>> DEBUG: WIRE: 41.0 -> org.osgi.service.packageadmin -> 0
>> DEBUG: WIRE: 41.0 -> org.ungoverned.osgi.service.shell -> 41.0
>> DEBUG: WIRE: 41.0 -> org.osgi.service.startlevel -> 0
>> DEBUG: WIRE: 41.0 -> org.osgi.framework -> 0
>> DEBUG: WIRE: 41.0 -> org.apache.felix.shell -> 41.0
>> DEBUG: WIRE: 42.0 -> org.osgi.framework -> 0
>> DEBUG: WIRE: 42.0 -> org.apache.felix.shell -> 41.0
>> -> DEBUG: WIRE: 43.0 -> org.osgi.service.obr -> 43.0
>> DEBUG: WIRE: 43.0 -> org.osgi.framework -> 0
>> DEBUG: WIRE: 43.0 -> org.apache.felix.shell -> 41.0
>> DEBUG: WIRE: 44.0 -> org.osgi.framework -> 0
>> DEBUG: WIRE: 44.0 -> org.osgi.service.cm -> 44.0
>> DEBUG: WIRE: 44.0 -> org.apache.felix.shell -> 41.0
>> DEBUG: WIRE: 44.0 -> org.apache.felix.scr -> 44.0
>> DEBUG: WIRE: 44.0 -> org.osgi.service.component -> 44.0
>> DEBUG: WIRE: 45.0 -> org.osgi.service.event -> 45.0
>> DEBUG: WIRE: 45.0 -> org.osgi.framework -> 0
>> DEBUG: EventAdmin: org.apache.felix.eventadmin.CacheSize=30
>> DEBUG: EventAdmin: org.apache.felix.eventadmin.ThreadPoolSize=10
>> DEBUG: EventAdmin: org.apache.felix.eventadmin.Timeout=5000
>> DEBUG: EventAdmin: org.apache.felix.eventadmin.RequireTopic=true
>>
>>
>> Any ideas?
>>
>> --
>> Parker Abercrombie <FI...@gmail.com>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
> 
> 
> 
> --
> Karl Pauls
> karlpauls@gmail.com
> 
> ---------------------------------------------------------------------
> 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: EventAdmin hangs when starting felix

Posted by Karl Pauls <ka...@gmail.com>.
Can you provide me with a little bit more information and a thread
dump please? What version of Felix are you using and what OS are you
running? You can create a thread dump as described at
http://java.sun.com/developer/technicalArticles/Programming/Stacktrace/

regards,

Karl

On Wed, Jul 23, 2008 at 3:24 AM,  <pa...@theokorigroup.com> wrote:
> When I start Felix, sometimes the process hangs. It doesn't happen every time. Maybe a race condition somewhere?
>
> This is my output, up to where things lock up:
>
> Welcome to Felix.
> =================
>
> DEBUG: WIRE: 41.0 -> org.osgi.service.packageadmin -> 0
> DEBUG: WIRE: 41.0 -> org.ungoverned.osgi.service.shell -> 41.0
> DEBUG: WIRE: 41.0 -> org.osgi.service.startlevel -> 0
> DEBUG: WIRE: 41.0 -> org.osgi.framework -> 0
> DEBUG: WIRE: 41.0 -> org.apache.felix.shell -> 41.0
> DEBUG: WIRE: 42.0 -> org.osgi.framework -> 0
> DEBUG: WIRE: 42.0 -> org.apache.felix.shell -> 41.0
> -> DEBUG: WIRE: 43.0 -> org.osgi.service.obr -> 43.0
> DEBUG: WIRE: 43.0 -> org.osgi.framework -> 0
> DEBUG: WIRE: 43.0 -> org.apache.felix.shell -> 41.0
> DEBUG: WIRE: 44.0 -> org.osgi.framework -> 0
> DEBUG: WIRE: 44.0 -> org.osgi.service.cm -> 44.0
> DEBUG: WIRE: 44.0 -> org.apache.felix.shell -> 41.0
> DEBUG: WIRE: 44.0 -> org.apache.felix.scr -> 44.0
> DEBUG: WIRE: 44.0 -> org.osgi.service.component -> 44.0
> DEBUG: WIRE: 45.0 -> org.osgi.service.event -> 45.0
> DEBUG: WIRE: 45.0 -> org.osgi.framework -> 0
> DEBUG: EventAdmin: org.apache.felix.eventadmin.CacheSize=30
> DEBUG: EventAdmin: org.apache.felix.eventadmin.ThreadPoolSize=10
> DEBUG: EventAdmin: org.apache.felix.eventadmin.Timeout=5000
> DEBUG: EventAdmin: org.apache.felix.eventadmin.RequireTopic=true
>
>
> Any ideas?
>
> --
> Parker Abercrombie <FI...@gmail.com>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>



-- 
Karl Pauls
karlpauls@gmail.com

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


EventAdmin hangs when starting felix

Posted by pa...@theokorigroup.com.
When I start Felix, sometimes the process hangs. It doesn't happen every time. Maybe a race condition somewhere?

This is my output, up to where things lock up:

Welcome to Felix.
=================

DEBUG: WIRE: 41.0 -> org.osgi.service.packageadmin -> 0
DEBUG: WIRE: 41.0 -> org.ungoverned.osgi.service.shell -> 41.0
DEBUG: WIRE: 41.0 -> org.osgi.service.startlevel -> 0
DEBUG: WIRE: 41.0 -> org.osgi.framework -> 0
DEBUG: WIRE: 41.0 -> org.apache.felix.shell -> 41.0
DEBUG: WIRE: 42.0 -> org.osgi.framework -> 0
DEBUG: WIRE: 42.0 -> org.apache.felix.shell -> 41.0
-> DEBUG: WIRE: 43.0 -> org.osgi.service.obr -> 43.0
DEBUG: WIRE: 43.0 -> org.osgi.framework -> 0
DEBUG: WIRE: 43.0 -> org.apache.felix.shell -> 41.0
DEBUG: WIRE: 44.0 -> org.osgi.framework -> 0
DEBUG: WIRE: 44.0 -> org.osgi.service.cm -> 44.0
DEBUG: WIRE: 44.0 -> org.apache.felix.shell -> 41.0
DEBUG: WIRE: 44.0 -> org.apache.felix.scr -> 44.0
DEBUG: WIRE: 44.0 -> org.osgi.service.component -> 44.0
DEBUG: WIRE: 45.0 -> org.osgi.service.event -> 45.0
DEBUG: WIRE: 45.0 -> org.osgi.framework -> 0
DEBUG: EventAdmin: org.apache.felix.eventadmin.CacheSize=30
DEBUG: EventAdmin: org.apache.felix.eventadmin.ThreadPoolSize=10
DEBUG: EventAdmin: org.apache.felix.eventadmin.Timeout=5000
DEBUG: EventAdmin: org.apache.felix.eventadmin.RequireTopic=true


Any ideas?

--
Parker Abercrombie <FI...@gmail.com>


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


Re: Wait for services to be fully registered?

Posted by jaredmac <jm...@mathworks.com>.

Marcel Offermans wrote:
> 
> On Aug 22, 2008, at 17:05 , jaredmac wrote:
> 
>> Just to close the loop on this thread, start levels work great to  
>> accomplish
>> what I need. [...] I realize this might not be in Felix's "design  
>> center," but until our GUI is
>> ready for more dynamic, asynchronous contribution, this works  
>> beautifully.
>> Thanks for everyone's help.
> 
> Not to re-open the discussion, but make sure you go down in start  
> level before updating any bundle to avoid breaking stuff on updates.  
> After the updates, go back up.
> 

Right, thanks. We're far away from updating bundles, but I will keep this in
mind! :)
-- 
View this message in context: http://www.nabble.com/Wait-for-services-to-be-fully-registered--tp17741822p19109728.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


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


Re: Wait for services to be fully registered?

Posted by Marcel Offermans <ma...@luminis.nl>.
On Aug 22, 2008, at 17:05 , jaredmac wrote:

> Just to close the loop on this thread, start levels work great to  
> accomplish
> what I need. [...] I realize this might not be in Felix's "design  
> center," but until our GUI is
> ready for more dynamic, asynchronous contribution, this works  
> beautifully.
> Thanks for everyone's help.

Not to re-open the discussion, but make sure you go down in start  
level before updating any bundle to avoid breaking stuff on updates.  
After the updates, go back up.

Greetings, Marcel


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


Re: Wait for services to be fully registered?

Posted by jaredmac <jm...@mathworks.com>.

Richard S. Hall wrote:
> 
> Could you send your entire configuration?
> 
> -> richard
> 
> jaredmac wrote:
>> Richard S. Hall wrote:
>>   
>>> No, this is not possible. However, in the config.properties file (or if 
>>> you are embedding a Felix instance, then you pass in the configuration 
>>> properties), you can specify which start level bundles will be installed 
>>> with. Check this document for the configuration properties:
> 

Just to close the loop on this thread, start levels work great to accomplish
what I need. Basically, I did the following:

1. Set the Start Level of the "consumer" GUI client bundle to 10 (arbitrary)
2. Leave the Start Level of the "producer" bundles at 1, their default
3. When Felix is installing bundles, it keeps track of the highest Start
Level it has seen. Then it sets its own Start Level to that value.

I realize this might not be in Felix's "design center," but until our GUI is
ready for more dynamic, asynchronous contribution, this works beautifully.
Thanks for everyone's help.
-- 
View this message in context: http://www.nabble.com/Wait-for-services-to-be-fully-registered--tp17741822p19108780.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


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


Re: Wait for services to be fully registered?

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Could you send your entire configuration?

-> richard

jaredmac wrote:
> Richard S. Hall wrote:
>   
>> No, this is not possible. However, in the config.properties file (or if 
>> you are embedding a Felix instance, then you pass in the configuration 
>> properties), you can specify which start level bundles will be installed 
>> with. Check this document for the configuration properties:
>>
>>     
>
> OK, thanks. This is helpful. I have assigned bundles start levels and told
> Felix to employ a start level that is higher than the bundles I've assigned
> -- i.e., the client bundles have start level "2" and Felix has start level
> "5":
>
>         configuration.put(FelixConstants.FRAMEWORK_STARTLEVEL_PROP, "5");
>
> At this point, shouldn't I expect those bundles to be ... automatically
> started? I'm confused by this JavaDoc:
>
> http://www2.osgi.org/javadoc/r4/org/osgi/service/startlevel/StartLevel.html
>
> It says: "When the Framework is launched, the Framework will enter start
> level one and all bundles which are assigned to start level one and whose
> autostart setting indicates the bundle should be started are started as
> described in the Bundle.start method. The Framework will continue to
> increase the start level, starting bundles at each start level, until the
> Framework has reached a beginning start level."
>
> So, I would think that I expect Felix to start at 0, then proceed up by one
> till it reaches 5, starting my bundles that have start level "2" along the
> way. But this doesn't appear to happen - the bundles simply remain in the
> INSTALLED state.
>
> Am I misunderstanding something in the doc, or doing something wrong?
>
> Thanks,
> Jared
>   

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


Re: Wait for services to be fully registered?

Posted by jaredmac <jm...@mathworks.com>.

Richard S. Hall wrote:
> 
> No, this is not possible. However, in the config.properties file (or if 
> you are embedding a Felix instance, then you pass in the configuration 
> properties), you can specify which start level bundles will be installed 
> with. Check this document for the configuration properties:
> 

OK, thanks. This is helpful. I have assigned bundles start levels and told
Felix to employ a start level that is higher than the bundles I've assigned
-- i.e., the client bundles have start level "2" and Felix has start level
"5":

        configuration.put(FelixConstants.FRAMEWORK_STARTLEVEL_PROP, "5");

At this point, shouldn't I expect those bundles to be ... automatically
started? I'm confused by this JavaDoc:

http://www2.osgi.org/javadoc/r4/org/osgi/service/startlevel/StartLevel.html

It says: "When the Framework is launched, the Framework will enter start
level one and all bundles which are assigned to start level one and whose
autostart setting indicates the bundle should be started are started as
described in the Bundle.start method. The Framework will continue to
increase the start level, starting bundles at each start level, until the
Framework has reached a beginning start level."

So, I would think that I expect Felix to start at 0, then proceed up by one
till it reaches 5, starting my bundles that have start level "2" along the
way. But this doesn't appear to happen - the bundles simply remain in the
INSTALLED state.

Am I misunderstanding something in the doc, or doing something wrong?

Thanks,
Jared
-- 
View this message in context: http://www.nabble.com/Wait-for-services-to-be-fully-registered--tp17741822p18517230.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


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


Re: Wait for services to be fully registered?

Posted by "Richard S. Hall" <he...@ungoverned.org>.
jaredmac wrote:
> Richard S. Hall wrote:
>   
>> However, if you really want to make sure everything starts before your 
>> GUI, you can put all of your service bundles in a lower start level than 
>> your GUI bundle; thus, by the time the GUI bundle starts, then all your 
>> services will be available.
>>
>>     
>
> Just following up on this. I want to do something like:
>
> Bundle-Name: Blah
> Bundle-SymbolicName: org.blah
> Bundle-Start-Level: 5
>
> in the Manifest. Is that possible? I see the Java API for it but no more
> dynamic approach.
>   

No, this is not possible. However, in the config.properties file (or if 
you are embedding a Felix instance, then you pass in the configuration 
properties), you can specify which start level bundles will be installed 
with. Check this document for the configuration properties:

    
http://cwiki.apache.org/FELIX/apache-felix-usage-documentation.html#ApacheFelixUsageDocumentation-configuringfelix

-> richard

> Thanks!
> Jared
>   

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