Should PDE cache startup state of bundles? [message #66600] |
Fri, 12 May 2006 12:33 |
Eclipse User |
|
|
|
Originally posted by: alex_blewitt.yahoo.com
I saw an odd issue this morning ... when starting up an Eclipse (RCP) application, a bundle is started manually with bundle.start() in the code (it's using services, so there's no specific dependency between the two). On the first run, this works fine, but on the second run it says that the bundle is already started. Cleaning the workspace doesn't seem to make any difference.
Exporting it as a product and running with a fresh standalone eclipse.exe doesn't exhibit this behaviour.
Should this be regarded as a bug in PDE? If so, I'll file a bug report about it ...
Alex.
|
|
|
Re: Should PDE cache startup state of bundles? [message #66642 is a reply to message #66600] |
Fri, 12 May 2006 22:20 |
Eclipse User |
|
|
|
Originally posted by: neil.integility.com
Alex,
It's not a bug, it's a feature!
Sorry, always wanted to say that...
Seriously though, the start state of an OSGi bundle is meant to be
persistent. To override this, use the -clean runtime switch (or set
osgi.clean=true).
Regards
Neil
|
|
|
Re: Should PDE cache startup state of bundles? [message #66682 is a reply to message #66642] |
Sat, 13 May 2006 08:08 |
Eclipse User |
|
|
|
Originally posted by: alex_blewitt.yahoo.com
Odd. I thought I tried it with the -clean, and it still remembered the persisted state. Also, when exporting and running as a standalone product (without the osgi.clean), it didn't remember the startup state. So I'm still confused as to which one is the bug :-)
I can see this causing a lot of headaches for PDE users that are used to testing out services. If it remembers the startup state of the bundles, then you can have something that works fine in an existing launch configuration, but then fails if you create a new launch configuration or exporting the product, especially since the -clean appears to have no effect (seems to be caching it in the configuration/ instead of the workspace/ directory).
Alex.
|
|
|
|
Re: Should PDE cache startup state of bundles? [message #68091 is a reply to message #67998] |
Wed, 24 May 2006 20:17 |
Eclipse User |
|
|
|
Originally posted by: alex_blewitt.yahoo.com
Just for other readers ... for Eclispe 3.1, it's Eclipse-LazyStart. For 3.2+, it's Eclipse-AutoStart IIRC.
Secondly, this approach works when you've got a class dependency, but doesn't work when you've got a service dependency, which is where the example came from. In that case, you don't have a direct class dependency so you have to start it manually to bring the service on line (of course, when the declarative services stuff goes live, you can use that instead).
Still, good summary of the information for anyone else that needs to know.
Alex.
|
|
|
Powered by
FUDForum. Page generated in 0.02791 seconds