Bug 134412 - [WorkbenchLauncher] No workspace prompt on startup
Summary: [WorkbenchLauncher] No workspace prompt on startup
Status: VERIFIED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 3.2 RC1   Edit
Assignee: equinox.compendium-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: greatbug
: 133569 134672 134715 134992 135421 135520 135805 136058 136699 140760 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-04-02 10:55 EDT by Gunnar Wagenknecht CLA
Modified: 2015-09-02 14:28 EDT (History)
26 users (show)

See Also:


Attachments
replacement jar (org.eclipse.osgi_3.2.0.v20060328.jar) for debugging that prints stack traces (835.56 KB, application/x-java-archive)
2006-04-03 10:27 EDT, Boris Bokowski CLA
no flags Details
startup trace (8.69 KB, text/plain)
2006-04-03 10:34 EDT, Michael Valenta CLA
no flags Details
Startup stack (8.59 KB, text/plain)
2006-04-03 11:23 EDT, Gunnar Wagenknecht CLA
no flags Details
Working startup stack (4.58 KB, text/plain)
2006-04-03 11:25 EDT, Gunnar Wagenknecht CLA
no flags Details
stack trace for the first start of InternetPlugin (1.53 KB, text/plain)
2006-04-03 13:22 EDT, Boris Bokowski CLA
no flags Details
example plug-in for reproducing the problem (2.29 KB, application/zip)
2006-04-03 13:52 EDT, Boris Bokowski CLA
no flags Details
patch (3.38 KB, patch)
2006-04-03 18:13 EDT, Thomas Watson CLA
no flags Details | Diff
patch (4.32 KB, patch)
2006-04-04 12:30 EDT, Thomas Watson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gunnar Wagenknecht CLA 2006-04-02 10:55:43 EDT
I don't know what happened. I installed 3.2 M6 yesterday evening and I'm pretty sure it prompted for a workspace. However, this morning it starts without prompting for a workspace although the preference is set. It always opens the workspace in <MY_WINDOWS_PROFILE>\workspace.

This is the content of my configuration/.settings/org.eclipse.ui.ide.prefs file.
#Sun Apr 02 10:44:21 EDT 2006
RECENT_WORKSPACES_PROTOCOL=2
MAX_RECENT_WORKSPACES=10
SHOW_WORKSPACE_SELECTION_DIALOG=true
eclipse.preferences.version=1
RECENT_WORKSPACES=D\:\\Development\\.......<more workspaces>

I start Eclipse using "eclipse.exe  -vmargs -XX:+UseParallelGC".

If I go to Window->Preferences->General->Startup the prompt for workspace preference is checked.
Comment 1 Gunnar Wagenknecht CLA 2006-04-02 11:06:03 EDT
That's weird. After restoring the content of my backup file from yesterday the prompt appears again.
Comment 2 Gunnar Wagenknecht CLA 2006-04-02 11:35:42 EDT
Ignore comment #1. It is related to one of my workspaces. As soon as I start this workspace and exit Eclipse the next time it starts with the default workspace (without prompting).

And now the most curious part. If I delete the folder configuration\org.eclipse.osgi\.manager then the workspace prompt reappears.
Comment 3 Kim Horne CLA 2006-04-02 11:52:04 EDT
(Applies to M6)
Comment 4 Boris Bokowski CLA 2006-04-03 00:13:13 EDT
*** Bug 133569 has been marked as a duplicate of this bug. ***
Comment 5 Boris Bokowski CLA 2006-04-03 00:34:15 EDT
I was not able to reproduce this.  I would be very interested in a workspace (and configuration directory) with which this can be reproduced.

I'm suspecting this has something to do with us (or someone else?) accessing the instance location before we have a chance to prompt.

DJ, do you know of any core-level changes that could affect the instance location before the IDEApplication gets to check if it is already set?
Comment 6 Boris Bokowski CLA 2006-04-03 00:38:45 EDT
Interesting detail (copied from bug 133569): "Starting with
-clean will prompt but removing the -clean will revert back to starting on the
default workspace location without prompting."
Comment 7 Walter Chang CLA 2006-04-03 02:54:14 EDT
well, i have the same issue.  one thing i found though is that if i do not install my own extension sites then things look ok.  my 2 cents.
Comment 8 Michael Valenta CLA 2006-04-03 08:40:29 EDT
I also use an extension site to load EMF so it may be related to that.
Comment 9 Gunnar Wagenknecht CLA 2006-04-03 08:41:03 EDT
I can confirm that starting with "-clean" also brings the prompt back. Thus, the severity can be reduced because a workaround is available. ;)

Boris, I can share my workspace if your are interested. But I think it's workspace independent. I'm also using different extension sites (some extension as links in the links directory and some added manually via UM).
Comment 10 Boris Bokowski CLA 2006-04-03 10:27:27 EDT
Created attachment 37520 [details]
replacement jar (org.eclipse.osgi_3.2.0.v20060328.jar) for debugging that prints stack traces
Comment 11 Michael Valenta CLA 2006-04-03 10:34:15 EDT
Created attachment 37522 [details]
startup trace
Comment 12 DJ Houghton CLA 2006-04-03 10:58:36 EDT
Looks like the WST plug-in is accessing the instance preferences before the data location is set?
Comment 13 Gunnar Wagenknecht CLA 2006-04-03 11:23:40 EDT
Created attachment 37535 [details]
Startup stack

I don't think it's WTP only. Looks like it's mylar in my case.
Comment 14 Boris Bokowski CLA 2006-04-03 11:24:27 EDT
I just talked to Jeff and John and we "narrowed it down":

The WTP plug-in accesses its preferences before we get to prompt for the workspace location.  The stack trace shows that the WTP plug-in was started explicitly (rather than lazily) in a previous session and is therefore started eagerly in this session.

The reason for this seems to be one of
 - UI's IDEWorkbenchWindowAdvisor.openWelcomeEditors()
 - deprecated 2.1 APIs - Plugin.start() and IPluginDescriptor.getPlugin()
 - WTP starting a plug-in explicitly
Comment 15 Gunnar Wagenknecht CLA 2006-04-03 11:25:04 EDT
Created attachment 37536 [details]
Working startup stack

For comparison, here is a startup trace taken with the "-clean" argument.
Comment 16 Boris Bokowski CLA 2006-04-03 11:27:09 EDT
Correction to comment #14: it wasn't Plugin.start(), but the Plugin(...) constructor
Comment 17 Boris Bokowski CLA 2006-04-03 11:41:39 EDT
I was able to reproduce this on my machine.
Comment 18 DJ Houghton CLA 2006-04-03 11:58:38 EDT
With WTP? Mylar? Base Eclipse?
Comment 19 Garret Wilson CLA 2006-04-03 12:30:35 EDT
I'm seeing this bug on 3.2M6 with WTP I200603302119 and Subclipse 0.8.102. After a fresh install of Eclipse+WTP, I was prompted for the default workspace, which I accepted. I installed Subclipse via an update, which required a restart. The next time I tried to start Eclipse from scratch, I was not prompted for a workspace, even though "prompt" was selected in the preferences. If I switch workspaces during a session, after restart I am placed back in the default workspace.

In response to Comment #14, I note that in Bug 130571 WTP finally made some modifications so that it wouldn't screw up the Subclipse menus. I have no idea if those fixes are related to this bug.
Comment 20 Boris Bokowski CLA 2006-04-03 13:22:57 EDT
Created attachment 37549 [details]
stack trace for the first start of InternetPlugin

I reproduced this with an extension site containing WTP M5. See the attached stack trace for how the plug-in is started the first time.
Comment 21 DJ Houghton CLA 2006-04-03 13:29:36 EDT
Steps:

- have a plug-in which implements the UI's IEarlyStartup extension
- extension does NOT specify a class to run (by default this loads the Plugin class)
- start Eclipse
- shutdown

On second startup, this plug-in is attempted to be restarted, before the application has begun to run.
Comment 22 Boris Bokowski CLA 2006-04-03 13:52:03 EDT
Created attachment 37551 [details]
example plug-in for reproducing the problem

Here is what I did to reproduce this (see the attached plug-in project)

- Markup in plugin.xml:
   <extension point="org.eclipse.ui.startup"/>
- The plug-in's activator class must implement IStartup.
- To reproduce the "no prompt on startup", the plug-in activator class must be a subclass of AbstractUIPlugin, and call getPreferenceStore() from its start() method.
- export the plug-in as a deployable jar and put it in the plugins directory of a clean 3.2M6 install
- start Eclipse (workspace prompt appears), then exit again
- start again (make sure you don't pass -clean), Eclipse comes up without prompting
Comment 23 John Arthorne CLA 2006-04-03 17:04:58 EDT
So the bug is in runtime compatibility, which calls Bundle.start() when IPluginDescriptor.getPlugin() is called. This will happen for any plugin that uses the org.eclipse.ui.startup extension point without specifying a class name (and anyone else using IPluginDescriptor.getPlugin). 
Comment 24 Thomas Watson CLA 2006-04-03 17:55:04 EDT
I've been working on a patch to this issue.  I will attach it soon ...
Comment 25 Thomas Watson CLA 2006-04-03 18:13:10 EDT
Created attachment 37566 [details]
patch

Patch to both org.eclipse.core.runtime and org.eclipse.core.runtime.compatibility.  This patch will attempt to load a class from the plugin first instead of explicitly calling the Bundle#start().  This will allow lazy started bundles to be activated without forcing them to be persistently started on a restart.

DJ/John please review and release if approved.
Comment 26 Thomas Watson CLA 2006-04-03 18:14:45 EDT
Boris, IDEWorkbenchWindowAdvisor#openWelcomeEditors does explicitly call Bundle#start.  Are you looking into changing that?  Is there a separate bug report on that?
Comment 27 Boris Bokowski CLA 2006-04-03 23:02:44 EDT
Re: comment #26
> Boris, IDEWorkbenchWindowAdvisor#openWelcomeEditors does explicitly call
> Bundle#start.  Are you looking into changing that?  Is there a separate bug
> report on that?

I filed bug 134648 to track this.  Thanks for reminding me!
Comment 28 Jeff McAffer CLA 2006-04-03 23:03:16 EDT
My 2c...  This is an important bug to fix rather than backing out of the change to persisting the start state of lazy bundles.  Without the persistence refinement it would be quite difficult for people to use other bundles that happen to call start in combination with bundles that are marked as lazy start.
Comment 29 John Arthorne CLA 2006-04-04 10:03:10 EDT
I'm wondering if we should even bother falling back to bundle.start() in the case where the class loading failed to activate the bundle?  This means someone is using legacy 2.1 APIs to activate a bundle that does not support LazyStart.  In this case they won't be aware of the consequence that they will cause the bundle to be auto-activated in all future sessions.  Failure seems like a better option here (i.e., don't support lazy activation of plugins that don't have the LazyStart directive).
Comment 30 Boris Bokowski CLA 2006-04-04 10:04:22 EDT
*** Bug 134672 has been marked as a duplicate of this bug. ***
Comment 31 Stefan Langer CLA 2006-04-04 10:22:58 EDT
Having the same problem. Seems to be mylar and wtp in my case.
Why is this bug still marked as new?
Comment 32 Boris Bokowski CLA 2006-04-04 10:40:19 EDT
*** Bug 134715 has been marked as a duplicate of this bug. ***
Comment 33 Andrew Hayden CLA 2006-04-04 10:44:59 EDT
Just adding myself to the CC list here - also having the issue and using WTP, and am interested in the final solution...
Comment 34 Thomas Watson CLA 2006-04-04 12:30:40 EDT
Created attachment 37644 [details]
patch

taking comment 29 from John into account.  I agree we should avoid calling Bundle#start here.  This patch does not call it and will throw an exception if the bundle is lazy started.  We do not want to start throwing exceptions for non-lazy started bundles.  Instead we need to fail silently here.  There are cases of non-lazy started bundles which we do not want to activate explicitly (org.eclipse.pde is one example).  It would be problematic to start logging errors/warnings for these bundles.
Comment 35 DJ Houghton CLA 2006-04-04 16:47:31 EDT
Looks good. I have also verified that this patch works with Boris' sample bundle.
Comment 36 John Arthorne CLA 2006-04-05 12:13:19 EDT
+1 - the latest patch looks good.
Comment 37 Eric Moffatt CLA 2006-04-05 12:33:16 EDT
*** Bug 134992 has been marked as a duplicate of this bug. ***
Comment 38 Jeff McAffer CLA 2006-04-05 14:06:13 EDT
+1
Comment 39 Thomas Watson CLA 2006-04-05 14:55:31 EDT
The latest patch has been released.
Comment 40 Gunnar Wagenknecht CLA 2006-04-07 09:42:00 EDT
Verified in N20060407
Comment 41 John Arthorne CLA 2006-04-07 10:30:04 EDT
*** Bug 135421 has been marked as a duplicate of this bug. ***
Comment 42 John Arthorne CLA 2006-04-07 10:30:12 EDT
*** Bug 135520 has been marked as a duplicate of this bug. ***
Comment 43 Boris Bokowski CLA 2006-04-07 17:16:19 EDT
Just for the record (since this is marked as a greatbug): Michael Valenta was the first to file this bug, see Bug 133569.
Comment 44 Eric Moffatt CLA 2006-04-10 15:54:46 EDT
*** Bug 135805 has been marked as a duplicate of this bug. ***
Comment 45 DJ Houghton CLA 2006-04-11 06:18:56 EDT
*** Bug 136058 has been marked as a duplicate of this bug. ***
Comment 46 DJ Houghton CLA 2006-04-17 11:51:56 EDT
*** Bug 136699 has been marked as a duplicate of this bug. ***
Comment 47 Randy Hudson CLA 2006-04-19 15:07:54 EDT
I am still seeing this problem in RC1. Is it because the startup state has been persisted from when the problem was introduced? Do I need to disable and reenabled the plugin causing the issue?
Comment 48 Gunnar Wagenknecht CLA 2006-04-19 15:17:34 EDT
(In reply to comment #47)
> I am still seeing this problem in RC1. Is it because the startup state has been
> persisted from when the problem was introduced? Do I need to disable and
> reenabled the plugin causing the issue?

I think you need to start with the "-clean" argument at least once. To get a fresh state.

Comment 49 Randy Hudson CLA 2006-04-19 15:32:09 EDT
Yes, that worked for me. I hesitated because I thought it would remove my extension locations.
Comment 50 Boris Bokowski CLA 2006-05-09 12:53:55 EDT
*** Bug 140760 has been marked as a duplicate of this bug. ***
Comment 51 bhuvana jag CLA 2014-08-18 06:30:54 EDT
Hi Thomas,
I wish to know how to apply this patch in my eclipse .
I have downloaded the .patch file .
I read somewhere that i could make a featured Patch project and then apply .

Am i doing this in the right way ? please help or could you guide me to the correct documentation?

Thanks in advance,
Bhuvana
Comment 52 Thomas Watson CLA 2014-08-18 08:39:54 EDT
(In reply to bhuvana jag from comment #51)
> Hi Thomas,
> I wish to know how to apply this patch in my eclipse .
> I have downloaded the .patch file .
> I read somewhere that i could make a featured Patch project and then apply .
> 
> Am i doing this in the right way ? please help or could you guide me to the
> correct documentation?
> 
> Thanks in advance,
> Bhuvana

What version of Eclipse are you using.  This was fixed in 3.2 SR1 (8 years ago).  Are you really patching an earlier version?  Do you see this issue in a later release?
Comment 53 bhuvana jag CLA 2014-08-19 02:13:06 EDT
Hi Thomas ,

I am using Version: 3.5.2.R35x_v20100119
Build id: M20100211-1343

I tried checking for updates from eclipse but still the issue persists.
Even -clean doesn't work for me.
Could you please help.

Regards,
Bhuvana
Comment 54 Mark Leone CLA 2015-09-02 14:27:38 EDT
I have an RCP based on Luna, and this problem still exists. I tried starting with -clean, and checking the preference to prompt for workspace location on startup. Nothing I found works.
Comment 55 Mark Leone CLA 2015-09-02 14:28:03 EDT
I have an RCP app based on Luna, and this problem still exists. I tried starting with -clean, and checking the preference to prompt for workspace location on startup. Nothing I found works.