Cocoon
  1. Cocoon
  2. COCOON-2286

Application does not start when the context path contains spaces

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.11
    • Fix Version/s: 2.1.12
    • Component/s: Blocks: Serializers
    • Labels:
      None

      Description

      When the CharsetFactory loads charsets from jar, the file path constructed from the jar URL may contains "%20" or other encoded special characters.
      An exception is thrown when the jar file is being accessed :


      Root cause: java.io.FileNotFoundException: D:\cocoon%20build\WEB-INF\lib\cocoon-serializers-charsets-2.1.11.jar (Le chemin d'accès spécifié est introuvable)
      at java.util.zip.ZipFile.open(Native Method)
      at java.util.zip.ZipFile.<init>(ZipFile.java:114)
      at java.util.zip.ZipFile.<init>(ZipFile.java:75)
      at org.apache.cocoon.components.serializers.encoding.CharsetFactory.loadCharsetsFromJar(CharsetFactory.java:130)

        Activity

        Cédric Damioli created issue -
        Hide
        Cédric Damioli added a comment -
        simple patch decoding file names
        Show
        Cédric Damioli added a comment - simple patch decoding file names
        Cédric Damioli made changes -
        Field Original Value New Value
        Attachment CharsetFactory.java.patch [ 12439889 ]
        Hide
        Sylvain Wallez added a comment -
        Patch applied, with one minor modification: use specify the "UTF-8" charset rather than relying on the JVM's default encoding
        Show
        Sylvain Wallez added a comment - Patch applied, with one minor modification: use specify the "UTF-8" charset rather than relying on the JVM's default encoding
        Sylvain Wallez made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 2.1.12-dev (Current SVN) [ 12312903 ]
        Resolution Fixed [ 1 ]
        Hide
        Cédric Damioli added a comment -
        I'm afraid you can't use the URLdecoder.decode(String, String) method which is not in the jdk 1.3 API

        I think Cocoon 2.1 must still be JDK 1.3 compatible. Am I wrong ?
        Show
        Cédric Damioli added a comment - I'm afraid you can't use the URLdecoder.decode(String, String) method which is not in the jdk 1.3 API I think Cocoon 2.1 must still be JDK 1.3 compatible. Am I wrong ?
        Hide
        Sylvain Wallez added a comment -
        Very good point! Now the top line in changes.xml says "Starting with 2.1.12 the minimum required Java version will be 1.4.2", so I guess we can safely use this method.
        Show
        Sylvain Wallez added a comment - Very good point! Now the top line in changes.xml says "Starting with 2.1.12 the minimum required Java version will be 1.4.2", so I guess we can safely use this method.

          People

          • Assignee:
            Unassigned
            Reporter:
            Cédric Damioli
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development