Spring Roo
  1. Spring Roo
  2. ROO-347

TilesOperations fails on Windows with spaces in path and also consumes root exceptions

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0.RC2
    • Fix Version/s: 1.0.0.RC3
    • Component/s: WEB MVC
    • Labels:
      None

      Description

      If you run script vote.roo on Windows from an empty directory that appears in a path containing a space, you get:

      java.lang.IllegalStateException: Unable to parse the tiles C:\springsource\roo-1
      .0.0.RC2\vote 3\src\main\webapp\WEB-INF\views\views.xml file
      at org.springframework.roo.addon.mvc.jsp.TilesOperations.<init>(TilesOperations.java:94)
      at org.springframework.roo.addon.security.SecurityOperations.installSecurity(SecurityOperations.java:87)

      The real root exception is also swallowed by the handling approach of:

      } catch (Exception e) {
      throw new IllegalStateException("Unable to parse the tiles " + viewFile + " file");
      }

      It would probably be useful to retain the root exception and pass it to the IllegalStateException constructor.

        Activity

        Hide
        Stefan Schmidt added a comment -

        I have tested a Roo RC2 application on Windows 7 using the vote script inside a directory that contains white spaces and it actually worked flawless. So I guess you must have tried it with XP or Vista.

        Anyway, I have committed a fix (rev 389) which should make the TilesIOException more expressive. Please test it and reopen should you encounter further issues.

        -Stefan

        Show
        Stefan Schmidt added a comment - I have tested a Roo RC2 application on Windows 7 using the vote script inside a directory that contains white spaces and it actually worked flawless. So I guess you must have tried it with XP or Vista. Anyway, I have committed a fix (rev 389) which should make the TilesIOException more expressive. Please test it and reopen should you encounter further issues. -Stefan
        Hide
        Christian Dupuis added a comment -

        This still crashes on Windows XP with Roo build from trunk rev 389.

        Roo installed into c:\spring-roo-1.0.0.RC3:

        1. cd c:\spring-roo-1.0.0.RC3
        2. mkdir "test 1"
        3. cd "test 1"
        4. ..\bin\roo.bat
        5. roo> development mode
        6. roo> script vote.roo

        security setup
        Managed ROOT\pom.xml
        Created SRC_MAIN_RESOURCES\META-INF\spring\applicationContext-security.xml
        Created SRC_MAIN_WEBAPP\WEB-INF\views\login.jspx
        Undo create SRC_MAIN_WEBAPP\WEB-INF\views\login.jspx
        Undo create SRC_MAIN_RESOURCES\META-INF\spring\applicationContext-security.xml
        Undo manage ROOT\pom.xml
        unknown protocol: c
        java.net.MalformedURLException: unknown protocol: c
            at java.net.URL.<init>(Unknown Source)
            at java.net.URL.<init>(Unknown Source)
            at java.net.URL.<init>(Unknown Source)
            at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
            at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
            at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
            at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
            at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
            at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
            at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source
            at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
            at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
            at org.springframework.roo.addon.mvc.jsp.TilesOperations.<init>(TilesOperations.java:71)
            at org.springframework.roo.addon.security.SecurityOperations.installSecurity(SecurityOperations.java:97)
            at org.springframework.roo.addon.security.SecurityCommands.installSecurity(SecurityCommands.java:33)
        

        my Java version

        C:\spring-roo-1.0.0.RC3\test 1>java -version
        java version "1.6.0_12"
        Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
        Java HotSpot(TM) Client VM (build 11.2-b01, mixed mode, sharing)
        
        Show
        Christian Dupuis added a comment - This still crashes on Windows XP with Roo build from trunk rev 389. Roo installed into c:\spring-roo-1.0.0.RC3: 1. cd c:\spring-roo-1.0.0.RC3 2. mkdir "test 1" 3. cd "test 1" 4. ..\bin\roo.bat 5. roo> development mode 6. roo> script vote.roo security setup Managed ROOT\pom.xml Created SRC_MAIN_RESOURCES\META-INF\spring\applicationContext-security.xml Created SRC_MAIN_WEBAPP\WEB-INF\views\login.jspx Undo create SRC_MAIN_WEBAPP\WEB-INF\views\login.jspx Undo create SRC_MAIN_RESOURCES\META-INF\spring\applicationContext-security.xml Undo manage ROOT\pom.xml unknown protocol: c java.net.MalformedURLException: unknown protocol: c at java.net.URL.<init>(Unknown Source) at java.net.URL.<init>(Unknown Source) at java.net.URL.<init>(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(Unknown Source) at org.springframework.roo.addon.mvc.jsp.TilesOperations.<init>(TilesOperations.java:71) at org.springframework.roo.addon.security.SecurityOperations.installSecurity(SecurityOperations.java:97) at org.springframework.roo.addon.security.SecurityCommands.installSecurity(SecurityCommands.java:33) my Java version C:\spring-roo-1.0.0.RC3\test 1>java -version java version "1.6.0_12" Java(TM) SE Runtime Environment (build 1.6.0_12-b04) Java HotSpot(TM) Client VM (build 11.2-b01, mixed mode, sharing)
        Hide
        Christian Dupuis added a comment -

        I just updated my JDK to the latest version (see below) and now it does work:

        C:\spring-roo-1.0.0.RC3\test 2>java -version
        java version "1.6.0_17"
        Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
        Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)
        

        That is a bit strange.

        Show
        Christian Dupuis added a comment - I just updated my JDK to the latest version (see below) and now it does work: C:\spring-roo-1.0.0.RC3\test 2>java -version java version "1.6.0_17" Java(TM) SE Runtime Environment (build 1.6.0_17-b04) Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing) That is a bit strange.
        Hide
        Christian Dupuis added a comment - - edited

        In the comments of http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6506304 you can find an outlined work-around by parsing the File object directly instead of passing the file path as a String.

        Maybe that would prevent other users from hitting this bug as you can't require to have the latest JDK 6 installed.

        Christian

        Show
        Christian Dupuis added a comment - - edited In the comments of http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6506304 you can find an outlined work-around by parsing the File object directly instead of passing the file path as a String. Maybe that would prevent other users from hitting this bug as you can't require to have the latest JDK 6 installed. Christian
        Hide
        Ben Alex added a comment -

        Well spotted, Christian.

        Stefan, maybe make line 71:

        tilesView = builder.parse(new File(viewFile)); // JDK 1.6 regression workaround as per http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6506304

        Stefan would you please install the specific JDK version Christian used (Windows 1.6.0_12) and see if you can execute all of the Roo scripts (clinic, vote, wedding). We really want to ensure Windows works well given ~70% of develoeprs are still on it.

        Show
        Ben Alex added a comment - Well spotted, Christian. Stefan, maybe make line 71: tilesView = builder.parse(new File(viewFile)); // JDK 1.6 regression workaround as per http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6506304 Stefan would you please install the specific JDK version Christian used (Windows 1.6.0_12) and see if you can execute all of the Roo scripts (clinic, vote, wedding). We really want to ensure Windows works well given ~70% of develoeprs are still on it.
        Hide
        Stefan Schmidt added a comment -

        Thanks Christian and Ben for investigating. I have checked in the workaround suggested by Ben (rev 392) and tested it on Win XP with Sun JDK 1.6.0.12. My tests worked fine. Please let me know if there are any further issues.

        Show
        Stefan Schmidt added a comment - Thanks Christian and Ben for investigating. I have checked in the workaround suggested by Ben (rev 392) and tested it on Win XP with Sun JDK 1.6.0.12. My tests worked fine. Please let me know if there are any further issues.
        Hide
        Ben Alex added a comment -

        Even though Stefan's commit in rev 392 would fix this, I've also added a reference to bug JDK 6506304 to the known issues section of the reference guide and recommended people use the latest Java 1.6 for their platform.

        Show
        Ben Alex added a comment - Even though Stefan's commit in rev 392 would fix this, I've also added a reference to bug JDK 6506304 to the known issues section of the reference guide and recommended people use the latest Java 1.6 for their platform.

          People

          • Assignee:
            Stefan Schmidt
            Reporter:
            Ben Alex
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: