Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 467819 - E4 project created from "New Plug-in" wizard does not generate Application.e4xmi
Summary: E4 project created from "New Plug-in" wizard does not generate Application.e4xmi
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.5 RC4   Edit
Assignee: Lars Vogel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 466269
Blocks:
  Show dependency tree
 
Reported: 2015-05-21 04:38 EDT by Vikas Chandra CLA
Modified: 2015-05-29 09:16 EDT (History)
8 users (show)

See Also:
Lars.Vogel: review+
daniel_megert: review+
olivier.prouvost: review+
dirk.fauth: review+


Attachments
The project created. No warning, no error ? (79.45 KB, image/png)
2015-05-21 04:51 EDT, Olivier Prouvost CLA
no flags Details
warning img (30.59 KB, image/jpeg)
2015-05-21 05:10 EDT, Vikas Chandra CLA
no flags Details
Expanded project snapshot (47.14 KB, image/jpeg)
2015-05-21 05:38 EDT, Vikas Chandra CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vikas Chandra CLA 2015-05-21 04:38:24 EDT
+++ This bug was initially created as a clone of Bug #466269 +++


Version: Mars (4.5)
Build id: I20150520-2000


- Open a new workspace and open the "New Plug-in Project" wizard.
- Give a name and click Next.
- Select "Yes" for "Would you like to create a rich client application?" and click Next.
- Select "Eclipse 4 RCP application" and click Finish.


-->The file "Application.e4xmi" does not exist in the workspace on build.properties.
Comment 1 Olivier Prouvost CLA 2015-05-21 04:50:08 EDT
Vikas, could you join a screenshot ? 

I did exactly the steps and I have no warning. The build.properties file contains the Application.e4xmi file and the project is clean... 

I add a screenshot to show you
Comment 2 Olivier Prouvost CLA 2015-05-21 04:51:58 EDT
Created attachment 253615 [details]
The project created. No warning, no error ?
Comment 3 Vikas Chandra CLA 2015-05-21 05:08:40 EDT
I do it on eclipse eclipse-SDK-I20150520-2000-win32-x86_64.zip. Have you installed something more on top of it.( like e4 tool core)
Comment 4 Vikas Chandra CLA 2015-05-21 05:10:12 EDT
Created attachment 253617 [details]
warning img
Comment 5 Olivier Prouvost CLA 2015-05-21 05:16:06 EDT
I test on mac with e4 tools.

But in your sample the file Application.e4xmi does not exist in your workspace ??
Comment 6 Dani Megert CLA 2015-05-21 05:19:46 EDT
(In reply to Olivier Prouvost from comment #5)
> I test on mac with e4 tools.
> 
> But in your sample the file Application.e4xmi does not exist in your
> workspace ??

e4 tools is not part of the SDK, that's probably the reason for the issue.
Comment 7 Olivier Prouvost CLA 2015-05-21 05:25:16 EDT
I can not reproduce it...  

Do you have the Application.e4xmi file generated in your workspace anyway ? Could you add a screenshot of the expanded generated project ? 

Do you have relative log messages ?
Comment 8 Vikas Chandra CLA 2015-05-21 05:38:24 EDT
Created attachment 253620 [details]
Expanded project snapshot
Comment 9 Olivier Prouvost CLA 2015-05-21 05:40:04 EDT
Could you try with the E4 tools installed (eclipse.platform.ui.tools) ?
Comment 10 Dani Megert CLA 2015-05-21 05:41:56 EDT
(In reply to Olivier Prouvost from comment #9)
> Could you try with the E4 tools installed (eclipse.platform.ui.tools) ?

I'd rather suggest the other way around. The wizard should not depend on the tools being installed.
Comment 11 Olivier Prouvost CLA 2015-05-21 05:49:55 EDT
Sure ! And I don't know why the Application.e4xmi file has not been generated in this case.. 

Vikas, could you go in the last page of the wizard (instead of clicking 'finish' directly), and generate a sample content ?  What will you get ?
Comment 12 Lars Vogel CLA 2015-05-22 06:56:03 EDT
(In reply to Dani Megert from comment #10)
> (In reply to Olivier Prouvost from comment #9)
> > Could you try with the E4 tools installed (eclipse.platform.ui.tools) ?
> 
> I'd rather suggest the other way around. The wizard should not depend on the
> tools being installed.

I can't reproduce this with a fresh download of 4.5.0.I20150521-1715 without any additional tool installed and a fresh workspace. The template is using a simple file copy (as the other templates in PDE) so there should be no requirement to install the e4 tools.

Marking as worksforme. Please reopen if you still can reproduce this.
Comment 13 Vikas Chandra CLA 2015-05-22 08:18:42 EDT
Still fails on Version: Mars (4.5)
Build id: I20150521-1715

Make sure to follow exact steps of comment#0
Comment 14 Olivier Prouvost CLA 2015-05-22 08:49:30 EDT
I can not still reproduce it.. 

Do you have any log ?
Comment 15 Lars Vogel CLA 2015-05-22 08:59:50 EDT
(In reply to Vikas Chandra from comment #13)
> Still fails on Version: Mars (4.5)
> Build id: I20150521-1715
> 
> Make sure to follow exact steps of comment#0

I did. Can you still reproduce it?
Comment 16 Lars Vogel CLA 2015-05-27 07:48:16 EDT
Dirk reports the same issue, i.e., Application.e4xmi is not generated.
Comment 17 Olivier Prouvost CLA 2015-05-27 08:49:59 EDT
I am really sorry guys but I can not reproduce this bug !! I launched the latest master branch without the e4 tooling and the application.e4xmi is well generated...
Comment 18 Lars Vogel CLA 2015-05-27 09:00:04 EDT
(In reply to Olivier Prouvost from comment #17)
> I am really sorry guys but I can not reproduce this bug !! I launched the
> latest master branch without the e4 tooling and the application.e4xmi is
> well generated...

Same here. @Dirk, can you describe which flag you are setting, maybe the easiest way is to make screenshots of the wizard pages?
Comment 19 Dirk Fauth CLA 2015-05-27 09:06:13 EDT
Build-ID: 4.5.0.I20150526-2010
OS: Windows 7 64bit

Installed e4 tools and EGit

File -> New -> Plug-in Project

Project name: test
Eclipse version: 3.5 or greater

Uncheck: Generate an Activator ...
Check: This plug-in will make contributions to the UI

Rich Client Application: Yes

Templates: Eclipse 4 RCP Application

Finish

--> No Application.e4xmi is created

Reproducible: Always
Comment 20 Dani Megert CLA 2015-05-27 15:12:04 EDT
(In reply to Dirk Fauth from comment #19)
> Build-ID: 4.5.0.I20150526-2010
> OS: Windows 7 64bit
> 
> Installed e4 tools and EGit
> 
> File -> New -> Plug-in Project
> 
> Project name: test
> Eclipse version: 3.5 or greater
> 
> Uncheck: Generate an Activator ...
> Check: This plug-in will make contributions to the UI
> 
> Rich Client Application: Yes
> 
> Templates: Eclipse 4 RCP Application
> 
> Finish
> 
> --> No Application.e4xmi is created
> 
> Reproducible: Always


I can reproduce this even without those steps:
> Installed e4 tools and EGit

This is with I20150526-2010 on Windows 7.
Comment 21 maarten meijer CLA 2015-05-28 03:28:00 EDT
Why is there a Application.e4xmi file both in root and in bin/ directory, that are totally different by the way?
Comment 22 Olivier Prouvost CLA 2015-05-28 03:32:36 EDT
Yes this is ok.

The file in bin is for the empty E4 application and is copied without any replacement. 

The file in the root directory is used for the sample content and is copied with the replacement of $windowTitle$.
Comment 23 Lars Vogel CLA 2015-05-28 04:21:39 EDT
(In reply to Dirk Fauth from comment #19)
> Build-ID: 4.5.0.I20150526-2010
> OS: Windows 7 64bit

In case you flag "Create sample content" does it still not create the Application.e4xmi?
Comment 24 Dani Megert CLA 2015-05-28 05:18:06 EDT
(In reply to Lars Vogel from comment #23)
> (In reply to Dirk Fauth from comment #19)
> > Build-ID: 4.5.0.I20150526-2010
> > OS: Windows 7 64bit
> 
> In case you flag "Create sample content" does it still not create the
> Application.e4xmi?

Nope.

And it looks strange to me that the generation of the 'Application.e4xmi' would be OS dependent.
Comment 25 Lars Vogel CLA 2015-05-28 05:25:53 EDT
(In reply to Dani Megert from comment #24)
> And it looks strange to me that the generation of the 'Application.e4xmi'
> would be OS dependent.

And yet it works perfectly for me on Ubuntu 15.04 and Olivier reports it works fine on Mac.
Comment 26 Dirk Fauth CLA 2015-05-28 05:42:59 EDT
> In case you flag "Create sample content" does it still not create the Application.e4xmi?

That checkbox is disabled for me. It is checked and I can't change it.

In the log I can see the following exception:

org.eclipse.core.internal.resources.ResourceException: Resource '/aaaa/Application.e4xmi' does not exist.
	at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:334)
	at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:208)
	at org.eclipse.core.internal.resources.File.getContents(File.java:267)
	at org.eclipse.core.internal.resources.File.getContents(File.java:260)
	at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl$WorkbenchHelper.createPlatformResourceInputStream(PlatformResourceURIHandlerImpl.java:207)
	at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createInputStream(PlatformResourceURIHandlerImpl.java:525)
	at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:360)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1269)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
	... 129 more

Is it possible that you are using locations that are OS specific? Is a relative location not resolved correctly? If it works on Ubuntu and Linux but not on Windows, this might be the reason.
Comment 27 Olivier Prouvost CLA 2015-05-28 06:01:41 EDT
The mechanism used for this template is already used in the other templates. I can't see why it wouldn't work on windows ??

Why the check box is disabled and you can not check it ?? This option is set in E4ApplicationTemplate and is never disabled in the code ?
Comment 28 Dirk Fauth CLA 2015-05-28 06:17:38 EDT
sorry, wrong checkbox

I never went to the last page of this wizard but finished on selecting the E4 template. This time I clicked Next and was able to set the checkbox. 

This is the reason for not getting the Application.e4xmi created. If the checkbox is disabled, it is not generated. And it is disabled by default, so performing a Finish before going to the last wizard page results in an invalid project stub with the missing e4xmi.

I'm not sure about this, but either this checkbox should be enabled by default, or the generation of the Application.e4xmi needs to be performed regardless of that checkbox state.

As I'm a stupid long time Eclipse user, I almost never go to the last page of a wizard if I'm not forced to and therefore come across such issues I can't explain. ;-)
Comment 29 Dani Megert CLA 2015-05-28 06:25:48 EDT
(In reply to Dirk Fauth from comment #28)
> sorry, wrong checkbox
> 
> I never went to the last page of this wizard but finished on selecting the
> E4 template. This time I clicked Next and was able to set the checkbox. 
> 
> This is the reason for not getting the Application.e4xmi created. If the
> checkbox is disabled, it is not generated. And it is disabled by default, so
> performing a Finish before going to the last wizard page results in an
> invalid project stub with the missing e4xmi.
> 
> I'm not sure about this, but either this checkbox should be enabled by
> default, or the generation of the Application.e4xmi needs to be performed
> regardless of that checkbox state.

Did you try the checkbox? For me even with that checked, it didn't generate the file (Windows 7).
Comment 30 Dirk Fauth CLA 2015-05-28 06:36:55 EDT
(In reply to Dani Megert from comment #29)
> (In reply to Dirk Fauth from comment #28)

> Did you try the checkbox? For me even with that checked, it didn't generate
> the file (Windows 7).

Yes I did and it created the file (Windows 7). Are you using 

Build-ID: 4.5.0.I20150526-2010

?
Comment 31 Lars Vogel CLA 2015-05-28 07:12:46 EDT
(In reply to Dani Megert from comment #29)
> Did you try the checkbox? For me even with that checked, it didn't generate
> the file (Windows 7).

Can you put a breakpoint into: org.eclipse.pde.ui.templates.AbstractNewPluginTemplateWizardgetNewFiles() and see what is included here?

For me, I see:

[icons/, css/default.css, Application.e4xmi]
Comment 32 Lars Vogel CLA 2015-05-28 07:13:10 EDT
org.eclipse.pde.ui.templates.AbstractNewPluginTemplateWizard#getNewFiles()
Comment 33 Lars Vogel CLA 2015-05-28 07:28:10 EDT
The other area for Windows user to debug would be:

E4ApplicationTemplate#isOkToCreateFile line 161:

if (fname.endsWith(E4_MODEL_FILE)) {
 
(sourceFile.getAbsolutePath().endsWith(EMPTY_E4_MODEL_FILE))
 return !getBooleanOption(KEY_CREATE_SAMPLE_CONTENT);

// This is the root file (containing the customized content), must keep it if content expected
	return getBooleanOption(KEY_CREATE_SAMPLE_CONTENT);
		}
Comment 34 Lars Vogel CLA 2015-05-28 07:35:31 EDT
I think I have it, I think the endsWith "bin/Application.e4xmi" does not work on Windows, IIRC Windows paths are "bin\Application.e4xmi". Patch coming..
Comment 35 Olivier Prouvost CLA 2015-05-28 07:53:00 EDT
excellent !
Comment 36 Dani Megert CLA 2015-05-28 07:56:43 EDT
(In reply to Dirk Fauth from comment #30)
> (In reply to Dani Megert from comment #29)
> > (In reply to Dirk Fauth from comment #28)
> 
> > Did you try the checkbox? For me even with that checked, it didn't generate
> > the file (Windows 7).
> 
> Yes I did and it created the file (Windows 7). Are you using 
> 
> Build-ID: 4.5.0.I20150526-2010
> 
> ?

Yes. Sorry, it's there if I check the checkbox. A filter was hiding the file.
Comment 37 Eclipse Genie CLA 2015-05-28 08:21:56 EDT
New Gerrit change created: https://git.eclipse.org/r/48855
Comment 38 Lars Vogel CLA 2015-05-28 08:24:32 EDT
(In reply to Eclipse Genie from comment #37)
> New Gerrit change created: https://git.eclipse.org/r/48855

Dani or Vikas, can you try this patch on Windows? Works fine under Linux, I play though all combination (finish without last screen, last screen no sample content, last screen sample content)
Comment 39 Olivier Prouvost CLA 2015-05-28 08:28:57 EDT
You were right Lars.. 

Actually in the other templates there is no condition to select or not a file in the bin directory ! I could not see this bug on mac... I installed a virtual box on my mac to test it better next time ! 

May be we could after this tricky bug, remove the old "new E4 project wizard" ?
Comment 40 Lars Vogel CLA 2015-05-28 09:32:33 EDT
(In reply to Olivier Prouvost from comment #39)
> You were right Lars.. 
> 
> Actually in the other templates there is no condition to select or not a
> file in the bin directory ! I could not see this bug on mac... I installed a
> virtual box on my mac to test it better next time ! 

So this works on Windows? In this case, please set the review flag. We need three people setting this flag.

> May be we could after this tricky bug, remove the old "new E4 project
> wizard" ?

I plan to do this early 4.6.
Comment 41 Dani Megert CLA 2015-05-28 09:35:13 EDT
See my comment in the Gerrit change.
Comment 42 Lars Vogel CLA 2015-05-28 09:40:52 EDT
(In reply to Dani Megert from comment #41)
> See my comment in the Gerrit change.

Gerrit review updated
Comment 43 Lars Vogel CLA 2015-05-28 09:55:04 EDT
I think I need one more +1 from a committer as I'm the author of this change. Vikas or Dirk?
Comment 45 Lars Vogel CLA 2015-05-28 10:18:31 EDT
Thanks everyone.
Comment 46 Vikas Chandra CLA 2015-05-29 07:03:37 EDT
FYI, this is not part of I20150528-0700 and hence not part of RC3.

I think a respin is NOT warranted.
Comment 47 Lars Vogel CLA 2015-05-29 07:33:18 EDT
(In reply to Vikas Chandra from comment #46)
> FYI, this is not part of I20150528-0700 and hence not part of RC3.

Can you verify this fix on Windows? On Linux it still works.

> I think a respin is NOT warranted.

Agree.
Comment 48 Vikas Chandra CLA 2015-05-29 09:16:08 EDT
>>Can you verify this fix on Windows?

I will wait for a build that incorporates this fix and then verify it.