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

Bug 206398

Summary: Export of (any) plugin invariably fails
Product: [Eclipse Project] PDE Reporter: Gary <gebarnes>
Component: BuildAssignee: pde-build-inbox <pde-build-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Gary CLA 2007-10-15 18:52:34 EDT
Build ID: M20060629-1905

Steps To Reproduce:
To duplicate the errors that I am seeing...

Start with File>New>Plugin Project
Type "aaa" in as the Project name and click Next
Put "com.aaa" in as the Plug-in ID and click Next
Select Plug-in with an editor and click Next
Then click Finish.

The plugin editor will bring up "com.aaa".  In the Overview page (at the bottom right of the window) click on "Export Wizard".  The com.aaa plugin is already selected (check mark'ed).  Tell it you want an Archive File and put the file anywhere, such as your home directory with any foo.zip filename.  I used /people/geb/foo.zip.
Cick on Finish.

You'll get an error dialog saying "Errors occured during the operation.  A zip  file containing the build logs has been generated and placed in <whereever you  put the zip file>".   Mine came out in /people/geb/logs.zip. If you look at the log file it will be filled with 167 errors all of the form:

# 10/15/07 3:38:06 PM PDT
# Eclipse Java Compiler 0.671, 3.2.0 release, Copyright IBM Corp 2000, 2006. All rights reserved.
----------
1. ERROR in /people/geb/workspace.linux/aaa/src/aaa/Activator.java
 (at line 3)
	import org.eclipse.jface.resource.ImageDescriptor;
	       ^^^^^^^^^^^^^^^^^
The import org.eclipse.jface cannot be resolved
----------


More information:
My own plugin gets 6097 errors.
Comment 1 Gary CLA 2007-10-18 15:34:10 EDT
I seem to have in some sense found the problem.  I have linked binary imports of the Eclipse internals in my workspace.  The problem goes away if I eliminate those imports.  Prior to Eclipse 3.2 I had to have them or my plugin would not compile.  Apparently something has changed.  If I eliminate those imports my code remains compiled and working.  No idea what changed in Eclipse or when.  Here is the text from a thread in the eclipse newsgroup from when I found the problem.

Walter Harley wrote:
> "Gary E. Barnes" <gebarnes@us.ibm.com> wrote in message 
> news:ff3f4t$g07$1@build.eclipse.org...
>> I run Eclipse with this command:
>>
>> /ned/java/eclipse.ss/460.cu/java/l86.3.2SDK.wrk/eclipse/eclipse \
>>     -data /people/geb/workspace.linux \
>>     -vm /usr/bin/java \
>>     -vmargs -Xmx1024m
>>
>> The directory /ned/java/eclipse.ss/460.cu/java/l86.3.2SDK.wrk/ is where 
>> Eclipse 3.2 is installed.
>>
>> And the versions for java/javac are: [snipped]
> 
> I see that you're running on Linux, with an IBM JVM (which I guess explains 
> why you were getting the Eclipse compiler; I imagine the IBM version of the 
> JDK uses the Eclipse compiler in its javac implementation?).
> 
> My first thought was that you were getting bitten by the problem with the 
> Ubuntu toolset containing a bad JRE.  But that doesn't seem to be the case.
> 
> I know that Eclipse is tested (and I imagine heavily used) with the IBM JVM, 
> but I wonder whether there's any possibility of your trying with the Sun JDK 
> temporarily to see whether that changes the behavior?  At the least that 
> would help people figure out how to proceed next.

I tried running bare Eclipse 3.2 (exactly as originally downloaded from eclipse.org) and in a new workspace I created an example project and exported it successfully.  I did this with GNU 1.4.3, Sun 1.5.0, the IBM 5.0 I've been using, and also with the latest release of IBM 5.0.  They all worked.

I then tried running that same Eclipse 3.2 against my real workspace with Sun 1.5.0 and both versions of IBM 5.0.  I could create a new example project same as before with all three.  And I could export that project using Sun 1.5.0 and the newer IBM 5.0 but not the older 5.0.  I was not able to export my real project with any of the three.
 
> 
>>> I wonder whether your 3.2.0 installation is corrupted in some way?
>> I suppose I could try to reinstall it.  I don't know of any other way to 
>> detect that sort of thing.
> 
> Nor do I.  But reinstalling is usually not a big deal, unless you've got a 
> lot of third-party plugins to deal with.

I'm using zero plugins (other than those that came with the 3.2 distro).
 
I started wondering if there was something in my workspace itself.  So I created a new empty workspace and did a CVS Project Import to get my project into the new workspace.  The first thing I notice is that my plugin isn't reporting any compilation errors.  I haven't imported any of the org.xxx projects shipped with Eclipse into the new workspace yet so I am surprised at this.  In the past whenever I would start a new workspace I had to go explicitly Import Plug-ins and Fragments into my workspace in order for my code to compile.  Consequently I had several dozen org.this.and.that binary projects listed in the workspace along with my own project.  That is apparently no longer necessary?  Formerly when I would use F3 on something I would end up in a unit in one of those org.something projects.  Now when I use F3 I end up in a unit that lives in org.something but it is displayed as being within my project's Plug-in Dependencies area.  This is very different behavior than before.  (I started on this project back in the timeframe of Eclipse 2.3 or thereabouts so many things have gone through many permutations.)

And now I can export my plugin.  Apparently the problem is something or other about my workspace.

So I go back to my real workspace (the one that won't export) and I delete all of the org.xxx binary projects that I had imported way back when.  Strangely my code remains compiled and happy, I wasn't expecting that.  And now I can export the plugin.

So apparently the problem has something to do with having all of the org.eclipse.* and org.this.and.that projects that make up Eclipse itself imported into the workspace.  I can write and debug and play with my plugin with that setup but exporting the plugin is not possible.

Now I'll have to see if the exported plugin actually works when put into an Eclipse.  That will be another chapter in the story I'm sure...

Thank you for your help.  I wouldn't have ever thought to eliminate the imports (because they had always been required before) without you having gotten me to start trying different combinations of jdk's and whatnot.

	Gary
Comment 2 Kevin McGuire CLA 2007-10-22 22:02:02 EDT
Moving to JDT for consideration.
Comment 3 Olivier Thomann CLA 2007-10-22 23:12:12 EDT
Moving to PDE/Build.
Can you generate the PDE build scripts and run them without errors?
Comment 4 Gary CLA 2007-10-22 23:52:55 EDT
> Can you generate the PDE build scripts and run them without errors?

Is that a question for me?  I don't know how to do either.  I just push buttons
on the GUI.

I tried creating a new workspace, imported all the fragments, and created a new
plugin project using the editor example, but it didn't duplicate the problem.

But if I go back to my (working) real workspace, import the org.eclipse.swt fragment plus all required fragments, my workspace is broken again.  If I delete the two fragments from the workspace then I can export my plugin again.

So how would I "generate the PDE build scripts" and how would I "run them"?

Comment 5 Andrew Niefer CLA 2007-10-23 11:29:34 EDT
(In reply to comment #4)
> > Can you generate the PDE build scripts and run them without errors?
> 
> So how would I "generate the PDE build scripts" and how would I "run them"?
> 

You can generate scripts by right-clicking on the manifest and going to PDE Tools -> Create Ant Build File.
This will generate a build.xml in the root of the plugin.
You can run that build.xml by right clicking on it and Run As->Ant Build

The problem here is caused by the linked binary imports which pde.build has problems with.  I'm marking this as a duplicate.

Some problems were fixed in 3.3, some are still outstanding.
As far as I know you don't need the binary plugins imported into your workspace to compile/self host.


*** This bug has been marked as a duplicate of bug 168365 ***