Bug 1277883

Summary: FileAlreadyExistsException - Designer tries to create new "globals" file when a project is copied
Product: [Retired] JBoss BPMS Platform 6 Reporter: Jan Hrcek <jhrcek>
Component: jBPM DesignerAssignee: Tihomir Surdilovic <tsurdilo>
Status: CLOSED EOL QA Contact: Kirill Gaevskii <kgaevski>
Severity: high Docs Contact:
Priority: high    
Version: 6.2.0CC: etirelli, kverlaen, lpetrovi, manstis
Target Milestone: ER2Keywords: Regression
Target Release: 6.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 20:11:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1263594    

Description Jan Hrcek 2015-11-04 10:04:12 UTC
Description of problem:
When copying existing project, Designer tries to create new globals file in VFS. This fails with Error modal dialog "File "/DEF/global" already exists." 

Version-Release number of selected component (if applicable):
BRMS ER5 / BPM Suite 6.2.0 ER5

How reproducible:
Always

Steps to Reproduce:
1. Go to project authoring and create new project "ABC"
2. In the project editor that is opened click 'rename' and select new name for the project "DEF"


Actual results:
Modal dialog "ERROR: File "/DEF/global" already exists."

Expected results:
No error when copying the project.

Additional info:
Comment from Michael Anstis:
Tiho will need to ensure Designer's org.jbpm.designer.repository.vfs.VFSRepository.createGlobalDirOnNewProject() method checks whether files already exist.

Please see the log. Looks like you'll need to check if files already exist in the "global" workspace before creating them.
------------------------------
11:03:42,504 ERROR [org.guvnor.common.services.backend.exceptions.ExceptionUtilities] (http-/127.0.0.1:8080-1) Exception thrown: null: org.uberfire.java.nio.file.FileAlreadyExistsException
	at org.uberfire.java.nio.fs.jgit.JGitFileSystemProvider.createDirectory(JGitFileSystemProvider.java:1012) [uberfire-nio2-jgit-0.7.4.Final-redhat-2.jar:0.7.4.Final-redhat-2]
	at org.uberfire.java.nio.file.Files.createDirectory(Files.java:259) [uberfire-nio2-api-0.7.4.Final-redhat-2.jar:0.7.4.Final-redhat-2]
	at org.uberfire.io.impl.IOServiceDotFileImpl.internalCreateDirectory(IOServiceDotFileImpl.java:327) [uberfire-io-0.7.4.Final-redhat-2.jar:0.7.4.Final-redhat-2]
	at org.uberfire.io.impl.IOServiceDotFileImpl.createDirectory(IOServiceDotFileImpl.java:128) [uberfire-io-0.7.4.Final-redhat-2.jar:0.7.4.Final-redhat-2]
	at org.jbpm.designer.repository.vfs.VFSRepository.createGlobalDirOnNewProject(VFSRepository.java:583) [jbpm-designer-backend-6.3.0.Final-redhat-3.jar:6.3.0.Final-redhat-3]

Comment 1 manstis 2015-11-04 11:07:23 UTC
I suspect it won't just be when a project is copied, but also if you try to create two or more projects in the same repository.

Comment 2 Jan Hrcek 2015-11-04 11:13:12 UTC
@Michael, actually no, creating multiple projects works without error modal.
But copying / renaming project throws the exception.

Comment 4 Lukáš Petrovický 2015-11-11 15:47:34 UTC
This is a confirmed regression from 6.1.

Comment 5 Jan Hrcek 2015-11-18 07:24:42 UTC
This fix didn't end up in 6.3.x branch despite being flagged as jboss-bpms-6.2.0+. Please cherry pick to 6.3.x

Comment 6 Kris Verlaenen 2016-03-15 15:00:01 UTC
This already seems fixed in master / 6.4.x branch

Comment 7 Jan Hrcek 2016-03-30 10:14:18 UTC
Verified with BPM Suite 6.3.0 ER2