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

Bug 276931

Summary: need way to synchronize output folders with build.properties
Product: [Eclipse Project] PDE Reporter: Pawel Pogorzelski <pawel.pogorzelski1>
Component: UIAssignee: Ankur Sharma <ankur_sharma>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aniefer, curtis.windatt.public, darin.eclipse, markus.kell.r, Olivier_Thomann, srikanth_sankaran
Version: 3.5   
Target Milestone: 3.6 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Pawel Pogorzelski CLA 2009-05-19 11:46:41 EDT
Build id: I20090515-1143

Some of the steps are probably not relevant, don't know which though.

Steps:
1. Check out org.eclipse.core.net from dev.eclipse.org
2. Disconnect project with CVS metadata removal
3. Create org.eclipse.core.net_src folder outside your workspace and put sources in it
4. Create org.eclipse.core.net_bin folder outside your workspace
5. Create linked folders src_ext and bin_ext in the project
6. Remove src from source folders and add src_ext
7. Change default output folder to bin_ext (confirm removal of the old one when prompted)
8. Remove src from your workspace and run self-hosted Eclipse

Expected:
9A. Guest Eclipse instance starts

Actual:
9B. Guest Eclipse instance crashes with following error:

eclipse.buildId=I20090515-1143
java.version=1.6.0_10-rc
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=pl_PL
Framework arguments:  -product org.eclipse.sdk.ide
Command-line arguments:  -product org.eclipse.sdk.ide -data C:\home\ppogorzelski\workspace-SDK-3.5RC1/../runtime-EclipseApplication -dev file:C:/home/ppogorzelski/workspace-SDK-3.5RC1/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/dev.properties -os win32 -ws win32 -arch x86


Error
Tue May 19 17:34:25 CEST 2009
Application error

java.lang.NoClassDefFoundError: org.eclipse.core.net.proxy.IProxyService
at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor.activateProxyService(IDEWorkbenchAdvisor.java:258)
at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor.postStartup(IDEWorkbenchAdvisor.java:238)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2343)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
Comment 1 Pawel Pogorzelski CLA 2009-05-21 05:56:53 EDT
This bug crashes self-hosted Eclipse during initialization. When do you expect to investigate the cause?
Comment 2 Srikanth Sankaran CLA 2009-05-25 02:45:42 EDT
Jay, can you please investigate this ? Thanks!
Comment 3 Pawel Pogorzelski CLA 2009-05-25 04:10:01 EDT
Bumping severity until we know exactly the settings along which the problem surfaces.
Comment 4 Jay Arthanareeswaran CLA 2009-05-25 08:36:21 EDT
Not able to reproduce this on Linux but can see the problem in Windows. Looking in to the bug.
Comment 5 Jay Arthanareeswaran CLA 2009-05-26 07:48:37 EDT
The following resolution seem to help:

1. Open the org.eclipse.core.net -> META_INF -> MANIFEST.MF
2. Click open the Build tab at the bottom
3. Under the 'Runtime Information' section, select the default library (.) and on the right hand side, click on 'Add Folder', which opens the folders in the project.
4. Select the 'src_ext' folder and 'OK'
5. Right click on the 'src' folder and 'Delete' and Ctrl+S to save.

Try running the Eclipse application after these steps and it should work.

I am still trying to find more information on this. For now, this should solve the issue.
Comment 6 Pawel Pogorzelski CLA 2009-05-26 07:56:21 EDT
Thanks for the update. Do you know what causes it? Is the linked source folder the setting to blame?
Comment 7 Jay Arthanareeswaran CLA 2009-05-26 08:57:24 EDT
From the eclipse's Plug-in Development Environment Guide:
------------
Plug-in Build

The Build page contains all the information needed to build, package and export the plug-in. Although it appears as a page in the plug-in manifest editor, changes made to it are written by PDE to the plug-in's build.properties file. The build.properties file solely guides the build process.
Runtime Information

The Runtime Information section lists all the libraries that you want to build. For each library, you must list the source folder(s) that will be compiled into the library. 
------------

As per this, all the build related information for a plug-in goes to the MANIFEST file. The source folders added through the "Configure Build path" goes inside the .project file, which is meant for the Eclipse Java projects. One might argue that changes made here should automatically reflect in the plug-in manifest also. But clearly that doesn't seem to be the case here or the intended behavior. In other words, to answer your question, for a plug-in to work with the linked folder, you have to replace the src with the src_ext in the MANIFEST and not in project's properties.
Comment 8 Pawel Pogorzelski CLA 2009-05-26 09:42:39 EDT
> In other words, to answer your question, for a plug-in to
> work with the linked folder, you have to replace the src with the src_ext in
> the MANIFEST and not in project's properties.
> 

So, looks like JDT and PDE use different settings in this case, right?
Comment 9 Pawel Pogorzelski CLA 2009-05-26 09:48:57 EDT
(In reply to comment #7)
> One
> might argue that changes made here should automatically reflect in the plug-in
> manifest also. But clearly that doesn't seem to be the case here or the
> intended behavior.

True. And if the setting is not replicated into the manifest it should be clearly stated. Current behaviour is confusing, at least for me.
Comment 10 Jay Arthanareeswaran CLA 2009-05-27 11:04:21 EDT
Andrew, your thoughts?
Comment 11 Pawel Pogorzelski CLA 2009-05-27 11:08:32 EDT
(In reply to comment #4)
> Not able to reproduce this on Linux but can see the problem in Windows. 

And why does it work on Linux? Is the setting replicated?
Comment 12 Andrew Niefer CLA 2009-05-27 11:21:56 EDT
My comments yesterday got lost somehow.
 Source folders should not be listed in the manifest.  The manifest describes where in the final built bundle the .class files will be.  


The build page describes how to build the project, it is a mapping of source folders to their final built location.

PDE/Core is in charge of setting up classpath mappings so that the self hosted eclipse can find the class files in the workspace.  These are automatically passed to the hosted eclipse using a -dev argument.

I don't know for sure, but PDE may be using the information on the build page to set up the -dev properties file. 
Comment 13 Darin Wright CLA 2009-05-27 11:43:16 EDT
(In reply to comment #12)

> I don't know for sure, but PDE may be using the information on the build page
> to set up the -dev properties file. 

PDE uses build.properties to generate dev.properties. Each output.* location/property is added to the dev entries. 
Comment 14 Andrew Niefer CLA 2009-05-27 13:54:57 EDT
(In reply to comment #13)
> PDE uses build.properties to generate dev.properties. Each output.*
> location/property is added to the dev entries. 
> 

Based on this, it seems to me that comment #5 is the correct solution.  (The Build tab in the editor is just a graphical UI version of the build.properties).
Comment 15 Srikanth Sankaran CLA 2009-05-28 00:32:06 EDT
(In reply to comment #14)
> (In reply to comment #13)
> > PDE uses build.properties to generate dev.properties. Each output.*
> > location/property is added to the dev entries. 
> > 
> Based on this, it seems to me that comment #5 is the correct solution.  (The
> Build tab in the editor is just a graphical UI version of the
> build.properties).


Thanks a lot Darin and Andrew for weighing in on this.
Pawel, can you try the solution outlined in comment #5
and confirm that it takes care of the problem for you ?

BTW, we did manage to reproduce the problem on Linux
also.
Comment 16 Pawel Pogorzelski CLA 2009-06-02 09:24:49 EDT
(In reply to comment #15)
> Pawel, can you try the solution outlined in comment #5
> and confirm that it takes care of the problem for you ?
 
Sure, I followed the steps and Eclipse started without problems.
Comment 17 Pawel Pogorzelski CLA 2009-06-02 09:37:50 EDT
Lowering severity.

Could we think of automatically replicating the setting from "Configure Build path" to build.properties? This could be done after displaying a prompt.
Comment 18 Szymon Brandys CLA 2009-08-17 09:22:03 EDT
I found another workaround for the initial steps. This workaround looks like a bug though.
The workaround is to not delete 'src' as stated in step 6. You should remove the folder content instead and leave the folder empty.
Eclipse will start.

Going further using Pawel's steps. I removed 'src' folder (as in step 6) and added another empty source folder 'b' to my project. I updated Runtime Information
to have there only 'b' folder. Eclipse starts. Remove 'b' from your project. Eclipse doesn't start.

It's not clear for me what happens here.
Pawel could you confirm? 

Comment 19 Pawel Pogorzelski CLA 2009-08-17 09:51:15 EDT
(In reply to comment #18)
> Going further using Pawel's steps. I removed 'src' folder (as in step 6) and
> added another empty source folder 'b' to my project. I updated Runtime
> Information
> to have there only 'b' folder. Eclipse starts. Remove 'b' from your project.
> Eclipse doesn't start.
> 
> It's not clear for me what happens here.
> Pawel could you confirm? 
 
Sure. I got the same behavior.
Comment 20 Darin Wright CLA 2009-12-10 12:55:08 EST
Using the 3.6 M4 candidate with improved build.properties validation, I get these warnings when I follow the steps in the original bug report:

Description	Resource	Path	Location	Type
'src/' is not a source folder.	build.properties	/org.eclipse.core.net	line 11	Plug-in Problem
src_ext/ is missing from source..	build.properties	/org.eclipse.core.net	line 11	Plug-in Problem
The folder "bin/" does not exist in the workspace	build.properties	/org.eclipse.core.net	line 12	Plug-in Problem

Using quick fixes to address the problems allows me to launch the workspace successfully. Marking fixed. Users can set the problem severities in build.properties to error if they want to be sure to catch these errors.