Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350474 - Cannot create JPA Diagram because Eclipse try to puts XML file in the wrong folder
Summary: Cannot create JPA Diagram because Eclipse try to puts XML file in the wrong f...
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: Diagram Editor (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 major with 6 votes (vote)
Target Milestone: 3.0.1   Edit
Assignee: Stefan Dimov CLA
QA Contact: Stefan Dimov CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-27 13:39 EDT by YOUNOUSS Abba Soungui CLA
Modified: 2011-09-21 04:56 EDT (History)
14 users (show)

See Also:
stefan.dimov: indigo+
stefan.dimov: juno+
stefan.dimov: pmc_approved? (david_williams)
raghunathan.srinivasan: pmc_approved+
stefan.dimov: pmc_approved? (naci.dai)
stefan.dimov: pmc_approved? (deboer)
karenfbutzke: pmc_approved?
stefan.dimov: pmc_approved? (kaloyan)
cbridgha: pmc_approved+
dimitar.giormov: review+


Attachments
Fix for both HEAD and R3_0_maintenance branches (6.49 KB, text/plain)
2011-09-13 09:40 EDT, Stefan Dimov CLA
no flags Details
patch for both HEAD and R3_0_maintenance branches (5.68 KB, patch)
2011-09-13 09:45 EDT, Stefan Dimov CLA
no flags Details | Diff
Fix for both HEAD and R3_0_maintenance branches - v3 (5.71 KB, patch)
2011-09-13 12:00 EDT, Stefan Dimov CLA
stefan.dimov: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description YOUNOUSS Abba Soungui CLA 2011-06-27 13:39:43 EDT
Build Identifier: 20110615-0604

When i try to open a diagram on a JPA project, i get an unexpected error saying 
"'Creating diagram for: jpa-test...' has encountered a problem.

Could not write file: /jpa-test/diagrams/jpa-test.xml."

I think that it's because, when creating the diagram, Eclipse always puts the name of the project before the folder specified in the JPA Diagram Editor properties, i.e for my project named "jpa-test", he always try to put the XML file in the folder "file:/jpa-test/diagrams". Unfortunately, there is no such a folder on my file system. 
I can solve this problem by creating this folder on the file system and giving writing access to the user running Eclipse, however this is a dirty solution. I think it that it would be better to put the XML file in the folder "file:/{project_location}/diagrams" instead of "file:/project_name/diagrams".

Reproducible: Always

Steps to Reproduce:
1. Create a JPA project on linux
2. Right-click on project
3. Select "JPA Tools" > "Open Diagram"
Comment 1 Ruslan CLA 2011-07-05 05:49:37 EDT
I have the same bug after install Eclipse Indigo 3.7 (before I used beta version of eclipse 3.7 with JPA Diagram Editor beta and all worked fine).
Comment 2 Stefan Dimov CLA 2011-07-06 08:04:15 EDT
We're working on it ...
Comment 3 Arindam Biswas CLA 2011-08-23 13:02:46 EDT
Still having the same issue on Indigo, Ubuntu 11.04 64bit
Comment 4 Archimedes Trajano CLA 2011-09-04 15:06:41 EDT
I have confirmed this behaviour on Indigo Mac OSX Lion
Comment 5 Stefan Dimov CLA 2011-09-13 09:40:41 EDT
Created attachment 203247 [details]
Fix for both HEAD and R3_0_maintenance branches
Comment 6 Stefan Dimov CLA 2011-09-13 09:45:51 EDT
Created attachment 203248 [details]
patch for both HEAD and R3_0_maintenance branches
Comment 7 Stefan Dimov CLA 2011-09-13 12:00:31 EDT
Created attachment 203262 [details]
Fix for both HEAD and R3_0_maintenance branches - v3
Comment 8 Dimitar Giormov CLA 2011-09-14 08:58:39 EDT
Reviewed and tested on OSX Lion.
The patch and the tests work.
Comment 9 Stefan Dimov CLA 2011-09-14 10:06:01 EDT
This is an ugly bug - the user can't even open an empty diagram. There are 5 votes for this bug.

No workaround.

The fix was tested manually and a new JUnit test is added. The manual and JUnit tests have been performed on Windows, Linux and OS XLion. 

The problem is a redundant code in ModelIntegrationUtil.copyExistingXMIContentAndDeleteFile(...). On OS different than Windows IFileStore.mkdir() expects an absolute path on the filesystem and it gets a path relative to the workspace root. However, this code is obsolete and redundant and the patch removes it - just a few lines of code. 
The fix was reviewed by Dimitar Giormov

The risk is low.
Comment 10 Raghunathan Srinivasan CLA 2011-09-14 15:28:05 EDT
This looks like a major issue. I assume this was not caught earlier because it occurs only on a non-win OS.
Comment 11 Stefan Dimov CLA 2011-09-14 16:02:45 EDT
(In reply to comment #10)
> This looks like a major issue. I assume this was not caught earlier because it
> occurs only on a non-win OS.

Correct!
Comment 12 David Williams CLA 2011-09-15 14:48:13 EDT
Can you confirm ... is this a regression from the Indigo release? 

Since the "final bits" are due by 5 PM Eastern, this will take a special exception to get into the common SR1 repo. 

Another option is have a patch "ready to go" for once SR1 is released next week. (as an update from webtools specific site).
Comment 13 Karen Butzke CLA 2011-09-15 15:33:22 EDT
I have checked in this patch, but only released the org.eclipse.jpt.jpadiagrameditor.ui plugin. Did not release the test plug-in because I made a change to the new required bundle to make it a version range. I think it is safer to add the new test at a later date.

Stefan, could you smoke test the new build when it's completed?
Comment 14 Stefan Dimov CLA 2011-09-16 02:43:24 EDT
> Stefan, could you smoke test the new build when it's completed?

Yes, I will do it.
Comment 15 Stefan Dimov CLA 2011-09-16 07:48:54 EDT
(In reply to comment #14)
> > Stefan, could you smoke test the new build when it's completed?
> Yes, I will do it.

Tested on Linux and Windows
Comment 16 Stefan Dimov CLA 2011-09-16 08:37:55 EDT
(In reply to comment #12)
> Can you confirm ... is this a regression from the Indigo release? 

Appears that the bug exists in the Indigo release.
Comment 17 David Williams CLA 2011-09-16 10:36:58 EDT
(In reply to comment #16)
> (In reply to comment #12)
> > Can you confirm ... is this a regression from the Indigo release? 
> 
> Appears that the bug exists in the Indigo release.

Ok, thanks. In that case, I will just say, to the rest of the PMC ... I think we sort of jumped the gun approving this bug/fix for a release-train-schedule-breaking exception to Indigo SR1 ... but, since Carl has already worked hard, at PMCs request, to push this through its stages, it would now do more harm to back it out. So, I will not object ... just documenting the communication problem. 

And, I'm glad its fixed! Thanks for fixing and thanks to others for reporting. It is a bad bug and good to have it done.
Comment 18 Stefan Dimov CLA 2011-09-17 02:49:28 EDT
(In reply to comment #17)
> (In reply to comment #16)
> > (In reply to comment #12)
> > > Can you confirm ... is this a regression from the Indigo release? 
> > 
> > Appears that the bug exists in the Indigo release.
> Ok, thanks. In that case, I will just say, to the rest of the PMC ... I think
> we sort of jumped the gun approving this bug/fix for a
> release-train-schedule-breaking exception to Indigo SR1 ... but, since Carl has
> already worked hard, at PMCs request, to push this through its stages, it would
> now do more harm to back it out. So, I will not object ... just documenting the
> communication problem. 
> And, I'm glad its fixed! Thanks for fixing and thanks to others for reporting.
> It is a bad bug and good to have it done.

Just one thing: We should've fix it earlier, but we didn't because of lack of resources. Sorry about that. :(
Comment 19 Stefan Dimov CLA 2011-09-20 08:41:11 EDT
Patch submitted and released in HEAD branch.
Comment 20 Karen Butzke CLA 2011-09-20 09:42:14 EDT
Stefan,
Could you change the new org.eclipse.core.filesystem required bundle to have a version range? I changed this in maintenance, but did not release the test plug-in.
Comment 21 Stefan Dimov CLA 2011-09-21 04:56:37 EDT
(In reply to comment #20)
> Stefan,
> Could you change the new org.eclipse.core.filesystem required bundle to have a
> version range? 

Done in HEAD ...