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

Bug 70176

Summary: [osgi] headers incorrectly cached when a bundle is installed from the update manager
Product: [Eclipse Project] Platform Reporter: Nick Boldt <nboldt>
Component: RuntimeAssignee: Pascal Rapicault <pascal>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: dj.houghton, dsmall, Ed.Merks, jeffmcaffer, marcelop, pascal, rory.steele, sonia_dimitrov, steven.wasleski, wassim.melhem
Version: 3.0   
Target Milestone: 3.0.1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Eclipse Workspace .log file for Scenario A1
none
Eclipse Workspace .log file for Scenario A2
none
Eclipse Workspace .log file for Scenario A3
none
Eclipse Workspace .log file for Scenario A4 none

Description Nick Boldt CLA 2004-07-15 20:03:22 EDT
To reproduce:

Setup:
1. Download Eclipse 3.0.0 and unpack.
2. Start Eclipse, then click Help > Software Updates > Find and Install...
3. Search for new features to install, then click [Next].
4. Click [New Remote Site...] and add
http://download.eclipse.org/tools/emf/updates/.
5. Expand twisty and select EMF SDK and EMF SDK R200406280827
(can also use the M200407150937 release to test as well, for EMF 2.0.1).
6. Click [Next], select EMF SDK, click [Next].
7. Accept license, click [Next].
8. Install to default plugin location, hit [Finish].
9. Restart when prompted.
10. Open Help > About Eclipse Platform.
11. Click [Feature Details].
12. Note that the Provider and Feature Name for all EMF/SDO/XSD features you
installed as part of the EMF SDK are present. Click OK.
13. Click [Plug-in Details].
14. Note that the Provider and Plug-in Name for all EMF/SDO/XSD features you
installed as part of the EMF SDK are present. Click OK twice.

Create an EMF Project from the wizard, importing from Rose model, per
instructions here:
http://download.eclipse.org/tools/emf/scripts/docs.php?doc=tutorials/clibmod/clibmod.html

Once the project is created, the genmodel should open in an editor. 

Per steps 2 & 3,
http://download.eclipse.org/tools/emf/scripts/docs.php?doc=tutorials/clibmod/clibmod.html#step2,
generate the model code, and editor code.

PROBLEM #1:

Launch model in a new workbench, and watch as the compiler errors roll in:
  import org.eclipse.emf.*; 
is no longer valid, even though it was obviously used to generate all that code.

PROBLEM #2:

1. Open the ecore file in src\model in your project. 
2. Leaving both the genmodel & ecore editors open, along with any .java editors
you opened to inspect the import problems in #1 above, close eclipse.
3. Restart eclipse. Note that the genmodel and ecore editors no longer work,
throwing "An error has occurred when creating this editor" instead of the editor.

POSSIBLE SYMPTOM:

1. Open Help > About Eclipse Platform.
2. Click [Feature Details].
3. Note that the Provider and Feature Name for all EMF/SDO/XSD features you
installed as part of the EMF SDK are now missing. Click OK.
4. Click [Plug-in Details].
5. Note that the Provider and Plug-in Name for all EMF/SDO/XSD features you
installed as part of the EMF SDK are now missing. Click OK twice.
Comment 1 Nick Boldt CLA 2004-07-15 20:21:41 EDT
Additional details and screen shots can be seen here:

http://emf.torolab.ibm.com/viewcvs/indextools.cgi/~checkout~/emf-home/docs/UsingUpdateManager/UsingUpdateManager.html

Planned test scenarios (I only got as far as the first 4 since they all failed):

http://emf.torolab.ibm.com/viewcvs/indextools.cgi/~checkout~/emf-home/docs/UsingUpdateManager/UM-test-scenarios.txt

Screen shots of the problems encountered in the A4 scenario:

http://emf.torolab.ibm.com/viewcvs/indextools.cgi/~checkout~/emf-home/docs/UsingUpdateManager/ScenarioA4.html
Comment 2 Nick Boldt CLA 2004-07-15 20:30:41 EDT
Investigation started as result of this bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=70129

and thus may be related, or at least another way of identifying the problem. I
can't reproduce his stack trace, however, but I have encountered something
similar  in the past with trying to get an EMF Project to open in a "dirty"
install of Eclipse.
Comment 3 Dorian Birsan CLA 2004-07-15 20:47:38 EDT
Are you running win2k on NTFS?
If no, do you see the problem on a windows machine with NTFS?
Can you attach the log file? Thanks.
Comment 4 Ed Merks CLA 2004-07-16 08:34:40 EDT
*** Bug 70129 has been marked as a duplicate of this bug. ***
Comment 5 Dorian Birsan CLA 2004-07-16 12:02:45 EDT
Just a couple of comments, slightly related to this bug (I am investigating it 
now):

The eclipse About dialog should only show branding features, not all the 
features installed. A branding feature is a feature that defines an associated 
branding plugins, either explicitly with "plugin" attribute in its feature.xml 
or by contributing a plugin with the same id as the feature. Branding info is 
usually taken out of the about.ini file contained in the associated branding 
plugin.
It looks like EMF is contributing 9 features as branding features. That's 
fine, but personally I think it is a bit too much.

The more important issue is the branding attributes: providerName, etc. should 
be defined in the about.ini, even though this may seem redundant, as some of 
those values are also defined in feature.xml. This I think is a bug/limitation 
in the update code, as it should pick the provider name from about.ini first, 
and if not found, from the feature.xml.
Comment 6 Dorian Birsan CLA 2004-07-16 12:08:24 EDT
I have to retract the last comment: the provider name is picked up from the 
branding plugin.xml, not from about.ini. Mea culpa...
Comment 7 Nick Boldt CLA 2004-07-16 12:55:30 EDT
Created attachment 13371 [details]
Eclipse Workspace .log file for Scenario A1

Eclipse Workspace .log file for Scenario A1
Comment 8 Nick Boldt CLA 2004-07-16 12:55:53 EDT
Created attachment 13372 [details]
Eclipse Workspace .log file for Scenario A2

Eclipse Workspace .log file for Scenario A2
Comment 9 Nick Boldt CLA 2004-07-16 12:56:34 EDT
Created attachment 13373 [details]
Eclipse Workspace .log file for Scenario A3

Eclipse Workspace .log file for Scenario A3
Comment 10 Nick Boldt CLA 2004-07-16 12:57:08 EDT
Created attachment 13374 [details]
Eclipse Workspace .log file for Scenario A4

Eclipse Workspace .log file for Scenario A4
Comment 11 Nick Boldt CLA 2004-07-16 12:57:39 EDT
Per question re: Win2K on NTFS, yes, I'm getting this behaviour on a
lab-standard-installed T40. Log files for Scenarios A1-A4 attached.
Comment 12 Dorian Birsan CLA 2004-07-16 13:11:37 EDT
Thanks Nick, I am able to reproduce the problem as well.

BTW, as I was following the steps to reproduce, I have encountered another 
problem, bug 70229. Do you see that behavior?
Comment 13 Nick Boldt CLA 2004-07-16 14:52:32 EDT
re: bug 70229

Yes, definitely. Some thoughts on that issue posted on that bug's page. I think
these items may be related. Are there any other UM sites for other Eclipse
plugins encountering these problems? If so, then it's platform... if not, then
it could be my site.xml content, per that other bug.
Comment 14 Dorian Birsan CLA 2004-07-17 00:02:56 EDT
Pascal, please take a look at this problem, it appears that there is some 
incorrect caching of bundle manifest headers.
Here is the simplified summary of this bug:

1. use eclipse 3.0 to install EMF SDK 3.0
2. as these are new plugins, the user can just click "Apply Now" so he does 
not need to restart after install.
3. the user can see all the features and plugins in the About dialog, in 
particular the provider name is Eclipse.org
4. restart eclipse. At this point, the About dialog shows nothing for the 
provider name. The provider name is obtained by the update code by getting the 
Bundle and doing getHeaders(). It appears that the headers have been 
incorrectly cached.
5. to validate this, remove the configuration/org.eclipse.osgi and 
configuration/org.eclipse.core.runtime, but leave the org.eclipse.update 
untouched.
6. restart, things work fine, the provider of the new features/plugins is 
Eclipse.org
7. shutdown and restart again, the provider is blanc.

To me, it looks like some odd behavior in manifest caching, and cannot see any 
unusual behavior in the update code. Please investigate a bit and see if you  
spot a problem in the framework. Thanks!
Comment 15 Dorian Birsan CLA 2004-08-01 23:32:25 EDT
*** Bug 71211 has been marked as a duplicate of this bug. ***
Comment 16 Nick Boldt CLA 2004-08-16 13:24:06 EDT
Nothing new on this bug in the past month (aside from dupe report). Is anyone
still looking at this problem?

Thanks!
Comment 17 Pascal Rapicault CLA 2004-08-18 11:28:53 EDT
I believe this bug is two fold. One is related to runtime (regarding the
problematic display of the headers) and the other seems to be related to PDE
(bugs #71823 and #72111).

Moving to platform runtime for the problem related to the manifest since the
others have already been fixed.

CC'ing Wassim for confirmation.
Comment 18 Wassim Melhem CLA 2004-08-18 12:09:14 EDT
Correct.  The fact that the plug-ins were missing in the runtime workbench was 
caused by bug 71823.
Comment 19 DJ Houghton CLA 2004-08-18 14:16:44 EDT
Investigate for 3.0.1
Comment 20 Rafael Chaves CLA 2004-08-18 17:35:43 EDT
Pascal, FYI: we had a similar bug fixed a week ago: see bug 71003 comment 3. The
problem there would only appear for plug-ins that happen to have a incomplete
MANIFEST.MF, for the second and successive times you run, but not for the first one.
Comment 21 Pascal Rapicault CLA 2004-08-19 17:18:02 EDT

*** This bug has been marked as a duplicate of 71003 ***
Comment 22 Nick Boldt CLA 2004-08-31 16:24:01 EDT
The following tests confirm that this bug is closed.

Starting with bare Eclipse install, then used UM against the EMF Secondary
Update Manager Site (http://emf.torolab.ibm.com/tools/emf/updates/,
http://downloads.eclipse.org/tools/emf/updates/, etc.) to add the new plugins,
to a new plugin Install Location (as listed under Help > Software Updates >
Manage Configuration... > Product Configuration). Several restarts later, still
working.

Tests used the following Eclipse and EMF builds.

PASSED: EMF SDK 2.0.1.M200408261626, Eclipse 3.0.1.M20040825
PASSED: EMF SDK 2.0.1.M200408261626, Eclipse 3.1.0.N20040831 

Also, to get around the issue of using a Discovery URL as an Update URL, I've
opened a new feature request against Platform / Update to ask that more than one
Update URL be possible (or to provide for secondary/alternate Update URLs) to
continue to provide this level of support. see bug 73004
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=73004)

Finally, there's a newly-discovered problem (unearthed as a result of this
bugfix) that shows that the label "EMF/SDO/XSD Secondary Update Site" when
checking for updates to previously-installed EMF versions appears as
"%secondaryUpdateSiteName" instead. I think this is a result of not having 

  secondaryUpdateSiteName=EMF/SDO/XSD Secondary Update Site

appear in all 11 feature.properties files within the EMF SDK (incl. XSD & SDO),
and will be testing this hypothesis with our next build. 
Comment 23 Nick Boldt CLA 2004-09-08 21:36:49 EDT
looks like this is now working. bug 72709 closed too.