You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Bertrand Delacretaz (JIRA)" <ji...@apache.org> on 2007/06/26 18:33:25 UTC

[jira] Created: (JCR-984) [PATCH] Make DocViewImportHandler more robust against broken Attributes.getURI() method

[PATCH] Make DocViewImportHandler more robust against broken Attributes.getURI() method
---------------------------------------------------------------------------------------

                 Key: JCR-984
                 URL: https://issues.apache.org/jira/browse/JCR-984
             Project: Jackrabbit
          Issue Type: Improvement
          Components: core
    Affects Versions: 1.3.1
            Reporter: Bertrand Delacretaz
         Attachments: DocViewImportHandler.patch

DocViewImportHandler throws NullPointerException when the XML parser (incorrectly) returns null for the Attributes.getURI() call.

This small patch makes it more robust against this.

Whether this is a good idea is debatable - failing loudly on a broken parser might be more desirable - let's see what people think.

The problem happened during testing when an old version of the XPP parser (http://www.extreme.indiana.edu/xgws/xsoap/xpp/) found its way in our webapp's war file (pull-parser-2.jar, md5sum=1a1a909825c1bfd9b0cdfa3b29969438).

It might be useful to log some info about which parser is being used, I'll see if I can contribute something for 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-984) [PATCH] Make DocViewImportHandler more robust against broken Attributes.getURI() method

Posted by "angela (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508453 ] 

angela commented on JCR-984:
----------------------------

i have the impression that the mentioned parser has more than one bug and i'm not sure, whether
we should start working around them. from my point of view (dev view) it is easier to find the source of this kind of problem if the code fails ungracefully with runtime exception instead of producing wrong results without complaining.

therefore i would prefer not to apply the patch as is.

however, adding some debug information about the parser used would for sure be useful for all kind of support.

angela

> [PATCH] Make DocViewImportHandler more robust against broken Attributes.getURI() method
> ---------------------------------------------------------------------------------------
>
>                 Key: JCR-984
>                 URL: https://issues.apache.org/jira/browse/JCR-984
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.3.1
>            Reporter: Bertrand Delacretaz
>            Priority: Trivial
>         Attachments: DocViewImportHandler.patch
>
>
> DocViewImportHandler throws NullPointerException when the XML parser (incorrectly) returns null for the Attributes.getURI() call.
> This small patch makes it more robust against this.
> Whether this is a good idea is debatable - failing loudly on a broken parser might be more desirable - let's see what people think.
> The problem happened during testing when an old version of the XPP parser (http://www.extreme.indiana.edu/xgws/xsoap/xpp/) found its way in our webapp's war file (pull-parser-2.jar, md5sum=1a1a909825c1bfd9b0cdfa3b29969438).
> It might be useful to log some info about which parser is being used, I'll see if I can contribute something for 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-984) [PATCH] Make DocViewImportHandler more robust against broken Attributes.getURI() method

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508474 ] 

Stefan Guggisberg commented on JCR-984:
---------------------------------------

i agree with angela.

btw: i resolved JCR-985 by applying bertrand's patch, i.e. it's now logged what parser is being used. 

> [PATCH] Make DocViewImportHandler more robust against broken Attributes.getURI() method
> ---------------------------------------------------------------------------------------
>
>                 Key: JCR-984
>                 URL: https://issues.apache.org/jira/browse/JCR-984
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.3.1
>            Reporter: Bertrand Delacretaz
>            Priority: Trivial
>         Attachments: DocViewImportHandler.patch
>
>
> DocViewImportHandler throws NullPointerException when the XML parser (incorrectly) returns null for the Attributes.getURI() call.
> This small patch makes it more robust against this.
> Whether this is a good idea is debatable - failing loudly on a broken parser might be more desirable - let's see what people think.
> The problem happened during testing when an old version of the XPP parser (http://www.extreme.indiana.edu/xgws/xsoap/xpp/) found its way in our webapp's war file (pull-parser-2.jar, md5sum=1a1a909825c1bfd9b0cdfa3b29969438).
> It might be useful to log some info about which parser is being used, I'll see if I can contribute something for 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-984) [PATCH] Make DocViewImportHandler more robust against broken Attributes.getURI() method

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

Bertrand Delacretaz updated JCR-984:
------------------------------------

    Priority: Trivial  (was: Major)

> [PATCH] Make DocViewImportHandler more robust against broken Attributes.getURI() method
> ---------------------------------------------------------------------------------------
>
>                 Key: JCR-984
>                 URL: https://issues.apache.org/jira/browse/JCR-984
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.3.1
>            Reporter: Bertrand Delacretaz
>            Priority: Trivial
>         Attachments: DocViewImportHandler.patch
>
>
> DocViewImportHandler throws NullPointerException when the XML parser (incorrectly) returns null for the Attributes.getURI() call.
> This small patch makes it more robust against this.
> Whether this is a good idea is debatable - failing loudly on a broken parser might be more desirable - let's see what people think.
> The problem happened during testing when an old version of the XPP parser (http://www.extreme.indiana.edu/xgws/xsoap/xpp/) found its way in our webapp's war file (pull-parser-2.jar, md5sum=1a1a909825c1bfd9b0cdfa3b29969438).
> It might be useful to log some info about which parser is being used, I'll see if I can contribute something for 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-984) [PATCH] Make DocViewImportHandler more robust against broken Attributes.getURI() method

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

Bertrand Delacretaz updated JCR-984:
------------------------------------

    Attachment: DocViewImportHandler.patch

> [PATCH] Make DocViewImportHandler more robust against broken Attributes.getURI() method
> ---------------------------------------------------------------------------------------
>
>                 Key: JCR-984
>                 URL: https://issues.apache.org/jira/browse/JCR-984
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.3.1
>            Reporter: Bertrand Delacretaz
>         Attachments: DocViewImportHandler.patch
>
>
> DocViewImportHandler throws NullPointerException when the XML parser (incorrectly) returns null for the Attributes.getURI() call.
> This small patch makes it more robust against this.
> Whether this is a good idea is debatable - failing loudly on a broken parser might be more desirable - let's see what people think.
> The problem happened during testing when an old version of the XPP parser (http://www.extreme.indiana.edu/xgws/xsoap/xpp/) found its way in our webapp's war file (pull-parser-2.jar, md5sum=1a1a909825c1bfd9b0cdfa3b29969438).
> It might be useful to log some info about which parser is being used, I'll see if I can contribute something for 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-984) [PATCH] Make DocViewImportHandler more robust against broken Attributes.getURI() method

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

angela resolved JCR-984.
------------------------

    Resolution: Won't Fix

> [PATCH] Make DocViewImportHandler more robust against broken Attributes.getURI() method
> ---------------------------------------------------------------------------------------
>
>                 Key: JCR-984
>                 URL: https://issues.apache.org/jira/browse/JCR-984
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.3.1
>            Reporter: Bertrand Delacretaz
>            Priority: Trivial
>         Attachments: DocViewImportHandler.patch
>
>
> DocViewImportHandler throws NullPointerException when the XML parser (incorrectly) returns null for the Attributes.getURI() call.
> This small patch makes it more robust against this.
> Whether this is a good idea is debatable - failing loudly on a broken parser might be more desirable - let's see what people think.
> The problem happened during testing when an old version of the XPP parser (http://www.extreme.indiana.edu/xgws/xsoap/xpp/) found its way in our webapp's war file (pull-parser-2.jar, md5sum=1a1a909825c1bfd9b0cdfa3b29969438).
> It might be useful to log some info about which parser is being used, I'll see if I can contribute something for 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-984) [PATCH] Make DocViewImportHandler more robust against broken Attributes.getURI() method

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508230 ] 

Bertrand Delacretaz commented on JCR-984:
-----------------------------------------

Just to clarify why the parser can change: it is selected using the default SAXParserFactory mechanism (and BTW that code is duplicated in SessionImpl and WorkspaceImpl):

SAXParserFactory factory = SAXParserFactory.newInstance();
...
SAXParser parser = factory.newSAXParser();


> [PATCH] Make DocViewImportHandler more robust against broken Attributes.getURI() method
> ---------------------------------------------------------------------------------------
>
>                 Key: JCR-984
>                 URL: https://issues.apache.org/jira/browse/JCR-984
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.3.1
>            Reporter: Bertrand Delacretaz
>         Attachments: DocViewImportHandler.patch
>
>
> DocViewImportHandler throws NullPointerException when the XML parser (incorrectly) returns null for the Attributes.getURI() call.
> This small patch makes it more robust against this.
> Whether this is a good idea is debatable - failing loudly on a broken parser might be more desirable - let's see what people think.
> The problem happened during testing when an old version of the XPP parser (http://www.extreme.indiana.edu/xgws/xsoap/xpp/) found its way in our webapp's war file (pull-parser-2.jar, md5sum=1a1a909825c1bfd9b0cdfa3b29969438).
> It might be useful to log some info about which parser is being used, I'll see if I can contribute something for this.

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