Bug 832910
Summary: | Designer doesn't load on Windows | ||
---|---|---|---|
Product: | [JBoss] JBoss Enterprise BRMS Platform 5 | Reporter: | Lukáš Petrovický <lpetrovi> |
Component: | BRM (Guvnor) | Assignee: | manstis |
Status: | VERIFIED --- | QA Contact: | |
Severity: | urgent | Docs Contact: | |
Priority: | unspecified | ||
Version: | BRMS 5.3.0.GA | CC: | tkobayas |
Target Milestone: | CR1 | ||
Target Release: | BRMS 5.3.0.GA | ||
Hardware: | Unspecified | ||
OS: | Windows | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 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: |
Description
Lukáš Petrovický
2012-06-18 07:51:38 UTC
I tried this steps: - unzip standalone version (BRMS-5.3.0-ER9) - check size of designer/stencilset/bpmn2.0jbpm/bpmn2.0jbpm.json (156KB) - open Guvnor - create/open BPMN process - check size of designer/stencilset/bpmn2.0jbpm/bpmn2.0jbpm.json (0B) I think that somewhere during loading of designer, a contain of this file is removed. Yeah, designer.war/stencilsets/bpmn2.0jbpm/bpmn2.0jbpm.json is 0 byte. Attaching a debugger, I observed JbpmPreprocessingUnit.readFile() fails to read designer.war/stencilsets/bpmn2.0jbpm/stencildata/bpmn2.0jbpm.orig private String readFile(String pathname) throws IOException { StringBuilder fileContents = new StringBuilder(); Scanner scanner = new Scanner(new File(pathname)); String lineSeparator = System.getProperty("line.separator"); try { while(scanner.hasNextLine()) { fileContents.append(scanner.nextLine() + lineSeparator); } return fileContents.toString(); } finally { scanner.close(); } } Scanner.hasNextLine() immediately returns false. Scanner should be instantiated with charsetName. Without it, Scanner uses platform encoding. (In my case, MS932) Scanner scanner = new Scanner(new File(pathname), "UTF-8"); A quick workaround is -Dfile.encoding=UTF-8 for JVM option. Thanks Toshiya! I guess this was introduced with the Japanese translations :) charset was added to the Scanner init and fix was committed to Designer master and 2.2.x branch (https://github.com/tsurdilo/process-designer/commit/d35b56cecc854f80eb57a8e7930dce8f86cd0876). Let me know if there is anything else. Ah, it was not enough. Even if it can read bpmn2.0jbpm.orig, it writes bpmn2.0jbpm.json in the platform encoding (in my case, MS932). It will result in non-UTF-8 JSON which browsers fail to parse. http://www.ietf.org/rfc/rfc4627.txt ==== 3. Encoding JSON text SHALL be encoded in Unicode. The default encoding is UTF-8. ==== Sent a pull request for it. https://github.com/tsurdilo/process-designer/pull/10 Confirmed that the latest 2.2.x (with the pull request) build worked for my Win7. (In reply to comment #5) > Confirmed that the latest 2.2.x (with the pull request) build worked for my > Win7. Geoffrey, please, merge the pull request, would you? Tiho's not gonna be able to do that. Was able to merge the pull request to 2.2.x and its also in master too. Thanks again Toshiya. This issue should contain the fixes. Please verify it on CR1. Screenshots from our tests show this was fixed in CR1 |