Bug 832910 - Designer doesn't load on Windows
Summary: Designer doesn't load on Windows
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRM (Guvnor)
Version: BRMS 5.3.0.GA
Hardware: Unspecified
OS: Windows
unspecified
urgent
Target Milestone: CR1
: BRMS 5.3.0.GA
Assignee: manstis
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-18 07:51 UTC by Lukáš Petrovický
Modified: 2025-02-10 03:20 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-02-10 03:20:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Lukáš Petrovický 2012-06-18 07:51:38 UTC
From Toshiya:

------------
Error: a is undefined
Source file: http://localhost:8080/designer/jsc/env_combined.js
line: 250

I switched to designer.dev=true and now the error is:

Error: namespace is undefined
Source file: http://localhost:8080/designer/js/Core/StencilSet/stencilsets.js
line: 83

I debugged around stencilsets.js/stencilset.js then I noticed that http://localhost:8080/designer/stencilset/bpmn2.0jbpm returns 0byte in Windows7

Comment 1 Sona Mala 2012-06-18 10:11:47 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.

Comment 2 Toshiya Kobayashi 2012-06-18 10:34:25 UTC
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.

Comment 3 Tihomir Surdilovic 2012-06-18 14:07:17 UTC
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.

Comment 4 Toshiya Kobayashi 2012-06-19 02:51:00 UTC
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

Comment 5 Toshiya Kobayashi 2012-06-19 03:18:02 UTC
Confirmed that the latest 2.2.x (with the pull request) build worked for my Win7.

Comment 6 Lukáš Petrovický 2012-06-19 06:31:17 UTC
(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.

Comment 7 Tihomir Surdilovic 2012-06-19 07:04:23 UTC
Was able to merge the pull request to 2.2.x and its also in master too. Thanks again Toshiya.

Comment 8 Ryan Zhang 2012-06-21 02:46:58 UTC
This issue should contain the fixes.
Please verify it on CR1.

Comment 9 Zuzana Krejčová 2012-06-21 13:09:07 UTC
Screenshots from our tests show this was fixed in CR1

Comment 18 Red Hat Bugzilla 2025-02-10 03:20:09 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.


Note You need to log in before you can comment on or make changes to this bug.