lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <>
Subject [jira] Updated: (SOLR-1656) XInclude's are resolved relative CWD, not instance dir
Date Thu, 24 Feb 2011 23:47:39 GMT


Uwe Schindler updated SOLR-1656:

    Attachment: SOLR-1656-mockup.patch

Here is a first mockup (branch_3.x like the previous patch) of the version with EntityResolver.

This patch has some backwards breaks, because for XML files it is always broken to parse without
a system identifier, so the ctors of SolrSchema and SolrConfig should not take InputStream
but more a InputSource wrapper. With this patch everything compiles and tests and resolves
correctly, but plugins using old methods may fail (needs review).

How it works:
The system identifier is no longer a plain filename with path, it gets initialized using a
custom URI scheme "solrres:". This scheme is resolved using the EntityResolver that utilizes
SolrResourceLoader. As long as somebody only gives relative URLs in XIncludes or anywhere
else (this is also extendable to other places, not only xinclude, e.g. external XML entities
inside XSLs, config of DIH,...).
The good thing with the separate scheme is, that somebody can still use absolute filesystem
URLs or even external URLs in the xincludes, by using full schemed URIs like file:///my/absolute/path.

Other places in Solr that load XML and support Xinclude must also changed to this, currently
almost every place where solr loads XML files from ResourceLoader using InputStreams are broken.

Questionable is also backwards compatibibility. Ideally there should be a loadResourceAsInputSource()
method in ResourceLoader so DIH can also use it, which would also break backwards (interface!).

This patch is currently only for review about the idea. Comments welcome!

> XInclude's are resolved relative CWD, not instance dir
> ------------------------------------------------------
>                 Key: SOLR-1656
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Hoss Man
>         Attachments: SOLR-1656-mockup.patch, SOLR-1656_Support_SAX_SystemId_via_wrapping_InputStream.patch,
> As noted on the mailing list, when an XInclude in a config files refrences a relative
path, it's resolved relative the CWD of the servlet container, and not the instanceDir of
the core...

This message is automatically generated by JIRA.
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message