You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org> on 2009/01/29 17:35:02 UTC

[jira] Updated: (SOLR-991) Add Detail To Configuration XML Parsing Error Messages

     [ https://issues.apache.org/jira/browse/SOLR-991?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shalin Shekhar Mangar updated SOLR-991:
---------------------------------------

    Attachment: SOLR-991.patch

Patch to log the name of the file (SolrConfig.xml in this case) and then re-throw the exception.

Solr already logs the start of schema parsing therefore it is easy to identify malformed schema.xml files. Unfortunately, the parser does not give us the exact position of the error.

I'll commit this shortly.

> Add Detail To Configuration XML Parsing Error Messages
> ------------------------------------------------------
>
>                 Key: SOLR-991
>                 URL: https://issues.apache.org/jira/browse/SOLR-991
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.4
>         Environment: jdk 1.6+, Tomcat 5.x, 6.x
>            Reporter: Michael Henson
>            Priority: Minor
>         Attachments: SOLR-991.patch
>
>
> When there is a parsing error in configuration xml files, the error message does not specify which file was being processed or what line caused the parse failure:
> === snip ===
> [Fatal Error] :33:54: The string "--" is not permitted within comments.
> Jan 27, 2009 6:07:54 PM org.apache.solr.common.SolrException log
> SEVERE: org.xml.sax.SAXParseException: The string "--" is not permitted within comments.
>         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.apache.solr.core.Config.<init>(Config.java:104)
>         at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:111)
>         at org.apache.solr.core.CoreContainer.create(CoreContainer.java:338)
>         at org.apache.solr.core.CoreContainer.load(CoreContainer.java:217)
> === snip ===
> As a result, finding minor typos in the config files can take quite a bit of user time. In this case the specific error was an extraneous space in the closing xml comment tag, "-- >" instead of "-->".

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