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

Hoss Man updated SOLR-3087:
---------------------------

    Attachment: SOLR-3087.patch

Romain: thanks for reporting this!

Amit: thanks for your patch with a fix! .. your changed definitely addresses 
the specific bug reported, but i'm worried that it really only deals with the 
specific case of fieldType and it might leave other holes where code validates 
(or may be updated to valide in the future) that only expected attributes are 
used.

So I've updated the patch to modify DOMUtil to ignore anything using the 
reserved xml namespace prefix.  patch also improves on the existing 
TestXIncludeConfig to demonstrate this bug and that the fix is working.
                
> XInclude not working on schema.xml
> ----------------------------------
>
>                 Key: SOLR-3087
>                 URL: https://issues.apache.org/jira/browse/SOLR-3087
>             Project: Solr
>          Issue Type: Bug
>          Components: Schema and Analysis
>    Affects Versions: 3.5
>            Reporter: Romain MERESSE
>            Assignee: Hoss Man
>              Labels: XInclude, schema.xml
>             Fix For: 4.0
>
>         Attachments: SOLR-3087.patch, SOLR-3087.patch
>
>
> I want to use XML XInclude mechanism (http://en.wikipedia.org/wiki/XInclude) 
> to include parts of schema.xml.
> When I try to include a fieldType, I get this exception :
> java.lang.RuntimeException: schema fieldtype 
> string2(org.apache.solr.schema.StrField) invalid 
> arguments:{xml:base=solrres:/schema_integration.xml}
>       at org.apache.solr.schema.FieldType.setArgs(FieldType.java:168)
>       at org.apache.solr.schema.IndexSchema$1.init(IndexSchema.java:467)
>       at org.apache.solr.schema.IndexSchema$1.init(IndexSchema.java:435)
>       at 
> org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:175)
>       at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:480)
>       at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:125)
>       at org.apache.solr.core.CoreContainer.create(CoreContainer.java:461)
>       at org.apache.solr.core.CoreContainer.load(CoreContainer.java:316)
>       at org.apache.solr.core.CoreContainer.load(CoreContainer.java:207)
>       at 
> org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:130)
>       at 
> org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:94)
>       at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
>       at 
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
>       at 
> org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:713)
>       at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
>       at 
> org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282)
>       at 
> org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518)
>       at 
> org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
>       at 
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
>       at 
> org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
>       at 
> org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
>       at 
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
>       at 
> org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
>       at 
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
>       at 
> org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
>       at org.mortbay.jetty.Server.doStart(Server.java:224)
>       at 
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
>       at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:985)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>       at java.lang.reflect.Method.invoke(Unknown Source)
>       at org.mortbay.start.Main.invokeMain(Main.java:194)
>       at org.mortbay.start.Main.start(Main.java:534)
>       at org.mortbay.start.Main.start(Main.java:441)
>       at org.mortbay.start.Main.main(Main.java:119)
>       at 
> org.mortbay.jetty.win32service.JettyServiceWrapperListener.start(JettyServiceWrapperListener.java:47)
>       at 
> org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:2788)
> I include 'schema_integration.xml' like this :
> schema.xml ->
> <?xml version="1.0" encoding="UTF-8" ?>
> <schema name="default" version="1.1">
>   <types>
>      <!-- Stuff -->
>      <xi:include href="schema_integration.xml" 
> xmlns:xi="http://www.w3.org/2001/XInclude"/>
>   </types>
>   <!-- Stuff -->
> </schema>
> schema_integration.xml ->
> <?xml version="1.0" encoding="UTF-8" ?>
> <fieldType name="string2" class="solr.StrField" sortMissingLast="true" 
> omitNorms="true"/>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to