Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333514 - SQL Results view fails to initialize on Eclipse 3.7
Summary: SQL Results view fails to initialize on Eclipse 3.7
Status: RESOLVED FIXED
Alias: None
Product: Data Tools
Classification: Tools
Component: SQL Results View (show other bugs)
Version: 1.9   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 1.9   Edit
Assignee: Brian Payton CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-04 16:19 EST by Brian Payton CLA
Modified: 2011-11-04 13:29 EDT (History)
1 user (show)

See Also:


Attachments
Patch for plugin o.e.d.sqltools.result (1.35 KB, patch)
2011-01-13 22:05 EST, Brian Payton CLA
no flags Details | Diff
Patch for plugin o.e.d.sqltools.result (1.19 KB, patch)
2011-01-14 13:48 EST, Brian Payton CLA
no flags Details | Diff
Patch for plugin o.e.d.sqltools.result (1.41 KB, patch)
2011-01-14 18:07 EST, Brian Payton CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Payton CLA 2011-01-04 16:19:15 EST
The DTP SQL Results view fails to initialize and open on Eclipse 3.7 when there are any previous results in the result history.  This is due to a runtime mismatch on the Lucene analysis service that the SQL Results view uses.  Apparently components compiled with the version of Lucene included in Eclipse 3.6 do not work with the version of Lucene shipped with Eclipse 3.7.  (I guess that's why the major version of the Lucene plugin changed :-(
Comment 1 Brian Payton CLA 2011-01-05 16:25:03 EST

*** This bug has been marked as a duplicate of bug 330571 ***
Comment 2 Brian Payton CLA 2011-01-11 12:57:17 EST
The problem in bug 330571 went away after the reporter reinstalled DTP, so this bug must not be a duplicate of that one after all.
Comment 3 Brian Payton CLA 2011-01-13 14:54:53 EST
I am removing the "Require-Bundle" entry for bundle org.apache.lucene.analysis from the MANIFEST.MF file of the DTP plugin org.eclipse.datatools.result.ui for both DTP 1.8.2 and 1.9.  This bundle is not used.  The Lucene "analysis" classes that the SQL Results view uses are actually located in the base Lucene plugin.

Note:  this does not solve the runtime problem on Eclipse 3.7 with Lucene.  This just removes one roadblock for running DTP on Eclipse 3.7.
Comment 4 Brian Payton CLA 2011-01-13 15:18:00 EST
Checked in MANIFEST.MF change, tagged to v201101140400 (v1.8.2) and v201101140415 (v1.9)
Comment 5 Brian Payton CLA 2011-01-13 22:00:16 EST
I consulted the Eclipse cross-project-issues-dev mailing list, and the recommended solution for this problem is to use Import-Package rather than Require-Bundle.  Then the classes will resolve no matter what bundle they are in.

I will modify the MANIFEST.MF file in plugin org.eclipse.datatools.sqltools.result to replace the Require-Bundle of org.apache.lucene with Import-Package statements for all the Lucene packages we use.  Note:  I'm setting the package version range to [1.9.0,3.0.0).  There is a possibility that the Eclipse platform will move to Lucene 3.x, but that version removes some deprecated Lucene classes, and I noticed that we use a deprecated class (org.apache.lucene.search.Hits).
Comment 6 Brian Payton CLA 2011-01-13 22:05:03 EST
I just confirmed that Hits will be removed in Lucene 3.0.  So I will leave the version range as [1.9.0,3.0.0), and we'll have to deal with it if Eclipse platform adopts Lucene 3.x.
Comment 7 Brian Payton CLA 2011-01-13 22:05:40 EST
Created attachment 186801 [details]
Patch for plugin o.e.d.sqltools.result
Comment 8 Brian Payton CLA 2011-01-14 13:31:10 EST
Grrr, Lucene 2.9.1 has version numbers attached to the exported packages, but 1.9.1 does not.  So I have to redo my patch without the version ranges on the Import-Package statements.
Comment 9 Brian Payton CLA 2011-01-14 13:48:55 EST
Created attachment 186841 [details]
Patch for plugin o.e.d.sqltools.result

Reworked the patch to remove the Import-Package version ranges, which don't work with Lucene 1.9.1.
Comment 10 Brian Payton CLA 2011-01-14 13:54:16 EST
Checked in fix, tagged to v201101150300
Comment 11 Brian Payton CLA 2011-01-14 18:07:01 EST
Created attachment 186861 [details]
Patch for plugin o.e.d.sqltools.result

Additional patch that adds version ranges of "[0.0.0,3.0.0)" to the Lucene Import-Package statements.
Comment 12 Brian Payton CLA 2011-01-14 18:11:23 EST
Added package version ranges of "[0.0.0,3.0.0)" to the Import-Package statements.  Tagged change to v201101150715.
Comment 13 Brian Payton CLA 2011-01-17 20:31:17 EST
Uh oh, now that I have the new DTP v1.9 build to test, I found the Import-Package statements do not solve the original problem of the missing Lucene class at runtime.

I also tried adding an optional Require-Bundle statement for the plugin org.apache.lucene.core, and that does not work either.
Comment 14 Brian Payton CLA 2011-01-19 16:46:19 EST
We have decided to try including the old version of Lucene (v1.9.1) with our DTP 1.9 distributions.  If we set our version range properly (to "[1.9.0,2.0.0)") and the Eclipse platform help plugin does the same (to "[2.9.0,3.0.0)"), then things should work OK.  (Keeping fingers crossed...)
Comment 15 Brian Payton CLA 2011-01-19 16:56:47 EST
I opened IPZilla bug CQ 4815 ( https://dev.eclipse.org/ipzilla/show_bug.cgi?id=4815 ) for the use of Apache Lucene 1.9.1 from Orbit in DTP 1.9.
Comment 16 Brian Payton CLA 2011-01-19 17:25:39 EST
I opened bug 334838 to the DTP build team to add the org.apache.lucene plugin v1.9.1 to our DTP 1.9 distributions.  See https://bugs.eclipse.org/bugs/show_bug.cgi?id=334838
Comment 17 Brian Payton CLA 2011-01-19 17:41:55 EST
FYI, the Eclipse platform team is updating the Lucene plugin version ranges in the MANIFEST.MF of plugin org.eclipse.help.base in Eclipse 3.7 to limit the lower version to 2.9.0.  See bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=334694.  This will prevent conflicts between our old version of the Lucene plugin and the newer version used by the Eclipse platform.
Comment 18 Brian Payton CLA 2011-01-20 15:54:04 EST
Changed the MANIFEST.MF of plugin org.eclipse.datatools.sqltools.result to have a Require-Bundle of org.apache.lucene with version range of [1.9.0,2.0.0) (in place of the Import-Package statements) to make sure we pick up the old version of Lucene, which is now bundled with the DTP distribution packages.

Tagged change to v201101210500.
Comment 19 Brian Payton CLA 2011-01-21 12:42:41 EST
OK, this problem appears to be finally resolved.  I tested the v20110121-1029 build against Eclipse 3.7, and it's working OK.
Comment 20 madsin356 CLA 2011-11-04 13:29:09 EDT
Go to work space directory > Open ".metadata" folder > Open ".plugins" folder > Open "org.eclipse.datatools.sqltools.result" folder.
Delete the "results" file.
Re-start the product and try again.