Bug 34128 - classpath incomplete
Summary: classpath incomplete
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.1   Edit
Hardware: PC Linux-GTK
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Veronika Irvine CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-07 14:29 EST by Andrew Irvine CLA
Modified: 2003-11-13 16:29 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Irvine CLA 2003-03-07 14:29:37 EST
Eclipse 200303062359
RH 8.0

I tried these steps on both windows and linux-gtk.  On windows I can launch a 
debug session, on linux I can not.

New workspace
Turn of automatic compile
Check the plug-ins org.eclipse.ui and all org.eclipse.ui.example.*
Select Add Required plug-ins
De-select org.apache.xerces (we need this as binary)
Say ok to the pop-up
Now import org.apache.xerces as binary
Now compile.

On gtk org.eclipse.jface fails to build because its classpath is incomplete.
Cannot find the class file for org.eclipse.swt.internal.gtk.gtkGdkEventKey

There is no swt-pi.jar in the directory workspace/org.eclipse.swt.gtk/ws/gtk
I only have swt.jar and swt-pisrc.zip

In the plug-ins directory I have both swt.jar and swt-pisrc.jar

I then copied the swt-pisrc.jar to workspace/org.eclipse.swt.gtk/ws/gtk/.
No effect.
Comment 1 Veronika Irvine CLA 2003-03-07 14:59:10 EST
Note that the class org.eclipse.swt.internal.gtk.GdkEventKey is in the swt-
pi.jar.
Comment 2 Wassim Melhem CLA 2003-03-07 15:08:29 EST
Andrew, Could you please clarify the following two steps:
>Check the plug-ins org.eclipse.ui and all org.eclipse.ui.example.*
>Select Add Required plug-ins

Are you importing?  Are you checking out from CVS?  I thought you were importing
using the plug-in import wizard.  However, org.eclipse.ui.example.* is not part
of the SDK, so I'm not sure what you're doing here.

>Say ok to the pop-up
Also, what pop-up???
Comment 3 Wassim Melhem CLA 2003-03-07 15:48:17 EST
I was able to reproduce the problem by importing org.eclipse.ui and all its
dependencies as source.

I will fix the problem.
However, as a workaround for now, go to the org.eclipse.swt.gtk project and
explicity make the the folder 'src-swt-pi' a source folder.
Then update the classpath of org.eclipse.jface, and everything should be fine.
Comment 4 Andrew Irvine CLA 2003-03-07 16:06:46 EST
The pop-up I referred to says something about not all projects being there, do 
you want us to do some action.  I don't remember the wording, but if you follow 
the steps I provided I am sure you will see it.

I download the examples along with the integration build and install both.  I 
thus see them in the import wizard.

What do I update the classpath variable to?

Do you not think fixing this is important enough for RC2?  If everyone who 
works with source has to do this, it is going to be quite a pain.
Comment 5 Andrew Irvine CLA 2003-03-07 16:12:40 EST
The exact message of the pop-up is:
"Some of the required plug-ins cannot be located.  Can we resolve them as 
project references?"

Kind of interesting since I asked for all required plug-ins.
Comment 6 Wassim Melhem CLA 2003-03-07 16:44:02 EST
Is this a regression?  Did it work before?  If so, what driver?
Comment 7 Andrew Irvine CLA 2003-03-07 16:58:12 EST
I don't understand what you mean by is this a regression.

I installed the integration build from this morning, the midnight build.  Gave 
it a brand new workspace and populated from source.

I have done this before in the past without issues.  Usually I pull the source 
for the UI from CVS, but I was trying different things this morning.  See bug 
#34133 for what happened when I pulled source from CVS.

I have not loaded my workspace from only the import dialog for quite a while, 
but I do know it worked.
Comment 8 Veronika Irvine CLA 2003-03-07 17:38:14 EST
It is a regression.

When testing integration builds we usually import all the external plugins and 
extract source and we have always been able to run eclipse within eclipse in 
the past.
Comment 9 Veronika Irvine CLA 2003-03-07 17:43:32 EST
Note that the org.eclipse.swt.gtk fragment is unique (even for SWT) because it 
includes a library in its fragment.xml declaration.  Most of the SWT frgaments 
contain the swt.jar but do not reference it in their fragment.xml.  GTK is 
unique for legal reasons.
Comment 10 Wassim Melhem CLA 2003-03-08 18:11:05 EST
Dejan,
The problem here is not specific to the swt fragment problem.
It actually affects importing the source of all runtime libraries whose name is 
a path of more than one segment: e.g. runtime/gef.jar for the org.eclipse.gef 
plugin and ws/gtk/swt-pi.jar for the swt.gtk fragment.
When we create an entry in the build.properties, we are currently creating an 
entry: source.gef.jar = src-gef/, while we should instead create 
source.runtime/gef.jar = src-gef/
Same with the swt.gtk library 
Comment 11 Dorian Birsan CLA 2003-03-11 21:21:39 EST
Approved for fixing in RC3
Comment 12 Dejan Glozic CLA 2003-03-13 20:12:43 EST
Fixed and verified using scenario described in comment #10 (importing
org.eclipse.ui and all its dependencies as source). 

We fixed this problem by creating the source.* key in build.properties using
full relative path of the library (not just its last segment). For example,
build.properties for the GTK fragment (when imported as source) now has the
following entry:

source.ws/gtk/swt-pi.jar = swt-pi-src/

Please verify with the next integration build (20030313).
Comment 13 Andrew Irvine CLA 2003-03-19 09:58:58 EST
Just tried this on GTK with I200303182359 (RC3), it does not work for the 
following scenario.

1/  Install Eclipse on GTK
2/  With new workspace, import plug-ins and fragments for org.eclipse.ui plus 
all required plug-ins.
3/  Note that org.eclipse.jface can not build due to the classpath problem:
"Cannot find the class file for org.eclipse.swt.internal.gtk.gtkGdkEventKey"

Tried a rebuild all, no effect.
Comment 14 Wassim Melhem CLA 2003-03-19 14:18:05 EST
Fixed.
Problem was due to the fact that we clear the classpaths of projects being 
imported in the first phase of the import operation.
Comment 15 Andrew Irvine CLA 2003-03-20 10:28:33 EST
I20030319
Comment 16 Andrew Irvine CLA 2003-03-28 08:31:30 EST
Tried the following on I200303272130 (RC4?)

Turn off auto-compile
From CVS load platform-core, platform-ui and platform-ui-examples
Import as source all required plug-ins for these packages

jface fails to compile due to incomplete class-path.
Comment 17 Wassim Melhem CLA 2003-03-28 10:30:14 EST
First, the solution: update the classpath of org.eclipse.jface explicitly using 
PDE's update classpath utility and everything will work fine.

Second, the explanation:
The problem is that the .classpath file that you checked out along with the 
org.eclipse.jface project from CVS is incomplete in a gtk scenario.  
That .classpath only contains references to the org.eclipse.swt plug-in.  On 
gtk, for jface to compile, the classpath needs to also reference 
org.eclipse.swt.gtk, *if this fragment contains source* in your workspace, 
which is the case here.
This is where PDE comes in.  When you update the classpath using PDE, PDE will 
check to see if org.eclipse.swt.gtk has source and will add it to 
org.eclipse.jface's classpath if it does.  Everything then compiles fine.
Note that if you had imported org.eclipse.jface with source using PDE's import 
instead of checking it out from the repository, the classpath would have been 
computed correctly by PDE right off the bat.
Comment 18 Veronika Irvine CLA 2003-03-28 10:57:43 EST
Can you explain why jface would require a reference to the org.eclipse.swt.gtk 
swt-pi.jar?  This jar contains only internal classes, to be more specific, it 
contains only those internal classes which define the JNI required to call the 
operating system calls.  I can guarantee that jface never calls any of the API 
in this jar.  So why does the jface classpath need to reference it?  Why is 
this different from how Windows works?

I am reopening this bug report.  Although there is a workaround, the default 
functionality is still incorrect.
Comment 19 Andrew Irvine CLA 2003-03-28 11:01:46 EST
I selected the plugin-xml for org.eclipse.jface, and choose the Update 
Classpath menu item.  It corrected the problem as indicated.
Comment 20 Wassim Melhem CLA 2003-03-28 11:46:46 EST
According to the JDT compiler, org.eclipse.jface.wizard.ProgressMonitorPart 
indirectly references the type 'org.eclipse.swt.internal.gtk.GdkEventKey' and 
that is why org.eclipse.jface cannot compile without adding the swt.gtk 
fragment directly to the classpath.  This is definitely not PDE domain.

I'm not sure what functionality of PDE is incorrect in Veronika's view.
Andrew checked out org.eclipse.jface from the repository with its .classpath 
(PDE is not involved at this step). He then imported org.eclipse.swt and its 
fragment using PDE's wizard, and the org.eclipse.jface's classpath (which PDE 
did NOT compute) was insufficient for compilation.
If anything, PDE actually can rescue such situations by updating the classpath 
of projects checked out from the repository.

Comment 21 Veronika Irvine CLA 2003-03-31 09:14:35 EST
Adding Phillipe to the discussion to understand why "According to the JDT 
compiler, org.eclipse.jface.wizard.ProgressMonitorPart 
indirectly references the type 'org.eclipse.swt.internal.gtk.GdkEventKey' and 
that is why org.eclipse.jface cannot compile without adding the swt.gtk 
fragment directly to the classpath."

ProgressMonitorPart only calls API that is defined in swt.jar.  The fact that 
swt.jar relies on API defined in swt-pi.jar should not require that 
ProgressMonitorPart also reference swt-pi.jar.  ProgressMonitorPart is no 
different from any other class that uses the SWT API so I do not see why it is 
requiring special treatment.
Comment 22 Philipe Mulet CLA 2003-03-31 09:23:40 EST
Kent - pls investigate.

It could be that indirectly some supertype is referring to some private 
implementation (on a method/field signature) and thus dragging internal 
components. Isn't this the case ? 
Comment 23 Andrew Irvine CLA 2003-03-31 15:27:56 EST
Compile errors are explainable due to the classpath being incomplete.  Note
swt.gtk and core.boot are added:

 
Classpath before update (with compile errors)
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="src" path="/org.apache.xerces"/>
    <classpathentry exported="true" kind="src" path="/org.eclipse.swt"/>
    <classpathentry kind="var" path="JRE_LIB" sourcepath="JRE_SRC"/>
    <classpathentry kind="src" path="/org.eclipse.core.runtime"/>
    <classpathentry kind="output" path="bin"/>
</classpath>

Classpath after update
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="src/"/>
    <classpathentry kind="src" path="/org.apache.xerces"/>
    <classpathentry exported="true" kind="src" path="/org.eclipse.swt"/>
    <classpathentry exported="true" kind="src" path="/org.eclipse.swt.gtk"/>
    <classpathentry kind="src" path="/org.eclipse.core.runtime"/>
    <classpathentry kind="src" path="/org.eclipse.core.boot"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="output" path="bin"/>
</classpath>
Comment 24 Veronika Irvine CLA 2003-03-31 15:45:17 EST
The super class of ProgressMonitorPart is a Composite which is an SWT widget 
and therefore is quite likely to call internal stuff in swt-pi.jar.

So why does the classpath of ProgressMonitor part need to include the stuff 
its super class references?
Comment 25 Wassim Melhem CLA 2003-05-28 21:21:32 EDT
Moving to JDT core as they investigate.
Comment 26 Philipe Mulet CLA 2003-06-02 05:45:56 EDT
Kent - is this a case where we could be more lazy when verifying inherited 
method signatures ? 
Comment 27 Kent Johnson CLA 2003-08-21 16:00:56 EDT
Veronika: Can you reproduce any of these scenarios on the latest build?
Comment 28 Veronika Irvine CLA 2003-11-13 16:29:09 EST
Retried sceanrios with 3.0 I20031113 build and did not get the errors.