You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Grégory Joseph (JIRA)" <ji...@apache.org> on 2008/10/29 20:26:44 UTC

[jira] Created: (JCR-1841) Workspace.xml can't be loaded if it has a BOM

Workspace.xml can't be loaded if it has a BOM
---------------------------------------------

                 Key: JCR-1841
                 URL: https://issues.apache.org/jira/browse/JCR-1841
             Project: Jackrabbit
          Issue Type: Bug
          Components: config, jackrabbit-core
    Affects Versions: core 1.4.6, 1.5.0
            Reporter: Grégory Joseph


I wondered if there was a specific reason why workspace.xml files are loaded using a FileReader instead of an InputStream in RepositoryConfig?

If the workspace.xml file has a BOM (which could happen if someone edited the file manually with some misbehaving editor), then it can't be loaded ("Content not allowed in prolog") - here's a little patch that fixes this.

I left the output part untouched (i.e still using a Writer) - which makes it a little inconsistent - maybe someone with a better knowledge of the JR FileSystem api could fix this.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1841) Workspace.xml can't be loaded if it has a BOM

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643637#action_12643637 ] 

Julian Reschke commented on JCR-1841:
-------------------------------------

Yep. I just wanted to clarify that a UTF-8 BOM is totally legal in an XML file.


> Workspace.xml can't be loaded if it has a BOM
> ---------------------------------------------
>
>                 Key: JCR-1841
>                 URL: https://issues.apache.org/jira/browse/JCR-1841
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: config, jackrabbit-core
>    Affects Versions: core 1.4.6, 1.5.0
>            Reporter: Grégory Joseph
>         Attachments: use_inputstream_toload_workspace_config.patch
>
>
> I wondered if there was a specific reason why workspace.xml files are loaded using a FileReader instead of an InputStream in RepositoryConfig?
> If the workspace.xml file has a BOM (which could happen if someone edited the file manually with some misbehaving editor), then it can't be loaded ("Content not allowed in prolog") - here's a little patch that fixes this.
> I left the output part untouched (i.e still using a Writer) - which makes it a little inconsistent - maybe someone with a better knowledge of the JR FileSystem api could fix this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1841) Workspace.xml can't be loaded if it has a BOM

Posted by "Grégory Joseph (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643635#action_12643635 ] 

Grégory Joseph commented on JCR-1841:
-------------------------------------

Because it makes Jackrabbit unhappy ;)

More seriously, simply because it modified the file - most likely - without informing the user. If some software modifies the format of a file it edits into what is essentially a different format, one could qualify that as misbehavior. That's sort out of the scope of this issue, though ;)

> Workspace.xml can't be loaded if it has a BOM
> ---------------------------------------------
>
>                 Key: JCR-1841
>                 URL: https://issues.apache.org/jira/browse/JCR-1841
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: config, jackrabbit-core
>    Affects Versions: core 1.4.6, 1.5.0
>            Reporter: Grégory Joseph
>         Attachments: use_inputstream_toload_workspace_config.patch
>
>
> I wondered if there was a specific reason why workspace.xml files are loaded using a FileReader instead of an InputStream in RepositoryConfig?
> If the workspace.xml file has a BOM (which could happen if someone edited the file manually with some misbehaving editor), then it can't be loaded ("Content not allowed in prolog") - here's a little patch that fixes this.
> I left the output part untouched (i.e still using a Writer) - which makes it a little inconsistent - maybe someone with a better knowledge of the JR FileSystem api could fix this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1841) Workspace.xml can't be loaded if it has a BOM

Posted by "Grégory Joseph (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1841?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grégory Joseph updated JCR-1841:
--------------------------------

    Attachment: use_inputstream_toload_workspace_config.patch

> Workspace.xml can't be loaded if it has a BOM
> ---------------------------------------------
>
>                 Key: JCR-1841
>                 URL: https://issues.apache.org/jira/browse/JCR-1841
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: config, jackrabbit-core
>    Affects Versions: core 1.4.6, 1.5.0
>            Reporter: Grégory Joseph
>         Attachments: use_inputstream_toload_workspace_config.patch
>
>
> I wondered if there was a specific reason why workspace.xml files are loaded using a FileReader instead of an InputStream in RepositoryConfig?
> If the workspace.xml file has a BOM (which could happen if someone edited the file manually with some misbehaving editor), then it can't be loaded ("Content not allowed in prolog") - here's a little patch that fixes this.
> I left the output part untouched (i.e still using a Writer) - which makes it a little inconsistent - maybe someone with a better knowledge of the JR FileSystem api could fix this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1841) Workspace.xml can't be loaded if it has a BOM

Posted by "Grégory Joseph (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643639#action_12643639 ] 

Grégory Joseph commented on JCR-1841:
-------------------------------------

It is, and unfortunately, as it stands, Jackrabbit won't support it.

> Workspace.xml can't be loaded if it has a BOM
> ---------------------------------------------
>
>                 Key: JCR-1841
>                 URL: https://issues.apache.org/jira/browse/JCR-1841
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: config, jackrabbit-core
>    Affects Versions: core 1.4.6, 1.5.0
>            Reporter: Grégory Joseph
>         Attachments: use_inputstream_toload_workspace_config.patch
>
>
> I wondered if there was a specific reason why workspace.xml files are loaded using a FileReader instead of an InputStream in RepositoryConfig?
> If the workspace.xml file has a BOM (which could happen if someone edited the file manually with some misbehaving editor), then it can't be loaded ("Content not allowed in prolog") - here's a little patch that fixes this.
> I left the output part untouched (i.e still using a Writer) - which makes it a little inconsistent - maybe someone with a better knowledge of the JR FileSystem api could fix this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1841) Workspace.xml can't be loaded if it has a BOM

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643628#action_12643628 ] 

Julian Reschke commented on JCR-1841:
-------------------------------------

Why would that be a "misbehaving" editor???


> Workspace.xml can't be loaded if it has a BOM
> ---------------------------------------------
>
>                 Key: JCR-1841
>                 URL: https://issues.apache.org/jira/browse/JCR-1841
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: config, jackrabbit-core
>    Affects Versions: core 1.4.6, 1.5.0
>            Reporter: Grégory Joseph
>         Attachments: use_inputstream_toload_workspace_config.patch
>
>
> I wondered if there was a specific reason why workspace.xml files are loaded using a FileReader instead of an InputStream in RepositoryConfig?
> If the workspace.xml file has a BOM (which could happen if someone edited the file manually with some misbehaving editor), then it can't be loaded ("Content not allowed in prolog") - here's a little patch that fixes this.
> I left the output part untouched (i.e still using a Writer) - which makes it a little inconsistent - maybe someone with a better knowledge of the JR FileSystem api could fix this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1841) Workspace.xml can't be loaded if it has a BOM

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666186#action_12666186 ] 

Jukka Zitting commented on JCR-1841:
------------------------------------

Merged to the 1.4 branch in revision 736684.

> Workspace.xml can't be loaded if it has a BOM
> ---------------------------------------------
>
>                 Key: JCR-1841
>                 URL: https://issues.apache.org/jira/browse/JCR-1841
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: config, jackrabbit-core
>    Affects Versions: core 1.4.6, 1.5.0
>            Reporter: Grégory Joseph
>            Assignee: Jukka Zitting
>             Fix For: 1.5.0, core 1.4.8
>
>         Attachments: use_inputstream_toload_workspace_config.patch
>
>
> I wondered if there was a specific reason why workspace.xml files are loaded using a FileReader instead of an InputStream in RepositoryConfig?
> If the workspace.xml file has a BOM (which could happen if someone edited the file manually with some misbehaving editor), then it can't be loaded ("Content not allowed in prolog") - here's a little patch that fixes this.
> I left the output part untouched (i.e still using a Writer) - which makes it a little inconsistent - maybe someone with a better knowledge of the JR FileSystem api could fix this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1841) Workspace.xml can't be loaded if it has a BOM

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1841?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-1841:
-------------------------------

    Fix Version/s: core 1.4.8

> Workspace.xml can't be loaded if it has a BOM
> ---------------------------------------------
>
>                 Key: JCR-1841
>                 URL: https://issues.apache.org/jira/browse/JCR-1841
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: config, jackrabbit-core
>    Affects Versions: core 1.4.6, 1.5.0
>            Reporter: Grégory Joseph
>            Assignee: Jukka Zitting
>             Fix For: 1.5.0, core 1.4.8
>
>         Attachments: use_inputstream_toload_workspace_config.patch
>
>
> I wondered if there was a specific reason why workspace.xml files are loaded using a FileReader instead of an InputStream in RepositoryConfig?
> If the workspace.xml file has a BOM (which could happen if someone edited the file manually with some misbehaving editor), then it can't be loaded ("Content not allowed in prolog") - here's a little patch that fixes this.
> I left the output part untouched (i.e still using a Writer) - which makes it a little inconsistent - maybe someone with a better knowledge of the JR FileSystem api could fix this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-1841) Workspace.xml can't be loaded if it has a BOM

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1841?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting resolved JCR-1841.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5.0
         Assignee: Jukka Zitting

Good catch, thanks! Patch applied in revision 709142.

> Workspace.xml can't be loaded if it has a BOM
> ---------------------------------------------
>
>                 Key: JCR-1841
>                 URL: https://issues.apache.org/jira/browse/JCR-1841
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: config, jackrabbit-core
>    Affects Versions: core 1.4.6, 1.5.0
>            Reporter: Grégory Joseph
>            Assignee: Jukka Zitting
>             Fix For: 1.5.0
>
>         Attachments: use_inputstream_toload_workspace_config.patch
>
>
> I wondered if there was a specific reason why workspace.xml files are loaded using a FileReader instead of an InputStream in RepositoryConfig?
> If the workspace.xml file has a BOM (which could happen if someone edited the file manually with some misbehaving editor), then it can't be loaded ("Content not allowed in prolog") - here's a little patch that fixes this.
> I left the output part untouched (i.e still using a Writer) - which makes it a little inconsistent - maybe someone with a better knowledge of the JR FileSystem api could fix this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.