Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339693

Summary: Starting a lazy-loading bundle causes it to be auto-started on eclipse startup
Product: [Eclipse Project] Platform Reporter: Chris McGee <cbmcgee>
Component: RuntimeAssignee: platform-runtime-inbox <platform-runtime-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: remy.suen, tjwatson
Version: 3.6.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Chris McGee CLA 2011-03-11 09:16:47 EST
What this effectively does is to make a bundle that is meant to be lazily loaded and makes it non-lazy. It may be some other third-party bundle that forces the bundle to start effectively overriding the lazy-loading design of the first bundle.

Steps to reproduce:

1) Launch eclipse 3.6.2 with the "-console" option
2) Select a well-known workspace
3) Wait until the workbench has fully loaded and all builds are finished, etc.
4) Invoke the "ss" command at the osgi prompt
5) Pick a bundle that is not in the active state (preferably one that is marked as "<<LAZY>>")
6) Shut down eclipse and restart it with the same workspace
7) Once eclipse has finished building, etc. invoke "ss" command again verifying that the same bundle is not "ACTIVE"
8) Invoke the "start" command on the bundle to activate it
9) Verify that the bundle is now in "ACTIVE" state according to the "ss" command
10) Shut down eclipse and restart with the same workspace
11) Wait until the workbench is loaded and all builds are finished
12) Invoke the "ss" command

Result:
The bundle is already active and will be active every time eclipse is restarted.

The above procedure mimics what I have seen when activating a bundle using Bundle.start(). In my case I did this once and expected that after a restart the bundle would resume its normal lazy-loading routine.
Comment 1 Thomas Watson CLA 2011-03-11 09:26:33 EST
This is working as specified by the OSGi Core specification.  Bundle.start() will perform an eager and persistent start operation.  If you don't want a bundle to be persistently started then use  Bundle.start(Bundle.START_TRANSIENT).
Comment 2 Chris McGee CLA 2011-03-11 09:33:31 EST
Thanks, I didn't know that this was intentional. I'll try the transient option next time.