On Mon, Jul 18, 2011 at 8:06 PM, Chris Hostetter <hossman_luc...@fucit.org> wrote: > > Can you post the details of your JVM / ServletContainer and the full stack > trace of the exception? My understanding is that fragment identifiers are > a mandatory part of the xinclude/xpointer specs. > > It would also be good to know if you tried the explicit "xpointer" > attribute approach on the xinclude syntax also mentioned in that thread... > > I think it owuld be something like... > > <xi:include href="solrconfigIncludes.xml" > xpointer="xpointer(//requestHandler)" /> > > > In general, Solr really isn't doing anything special with XInclude ... > it's all just delegated to the XML Libraries. You might want to start by > ignoring solr, and reading up on XInclude/XPointer tutorials in general, > and experimenting with command line xml tools to figure out the syntax you > need to get the "final" xml structures you want -- then aply that > knowledge to the solr config files. > > > -Hoss
This is running on java 1.6.0_26, and jetty 7.4.4.v20110707. The stack trace in the case of the use of the fragment is: 2011-07-13 18:52:42,953 [main] ERROR org.apache.solr.core.Config - Exception during parsing file: solrconfig.xml:org.xml.sax.SAXParseException: Fragment identifiers must not be used. The 'href' attribute value '../../conf/solrconfigIncludes.xml#xpointer(root/node())' is not permitted. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) at com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler.reportError(Unknown Source) at com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler.reportFatalError(Unknown Source) at com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler.handleIncludeElement(Unknown Source) at com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler.emptyElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) 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 org.apache.solr.core.Config.<init>(Config.java:159) at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:131) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:435) 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.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:99) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:742) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:245) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1208) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:586) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:449) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58) at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:89) at org.eclipse.jetty.server.Server.doStart(Server.java:258) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58) at com.issinc.cidne.solr.App.main(App.java:41) I did attempt the xpointer="xpointer(//requestHandler)" syntax, and received this error: 2011-07-13 18:49:06,640 [main] WARN org.apache.solr.core.Config - XML parse warning in "solrres:/solrconfig.xml", line 3, column 133: SchemeUnsupported: The XPointer scheme 'xpointer' is not supported. This matches what the wiki page indicates, and the Xerces FAQ confirms, which is that Xerces does not support the xpointer() scheme. I was not able to find any indication that there was any Java libraries available that do support the xpointer scheme. If anyone knows of one, and how to configure Solr to use it, that would almost certainly fix my problem. I do understand that Solr isn't doing anything special with XInclude. But from my attempts to understand the state of XInclude on the JVM, I am unable to identify a useful technique for taking advantage of it to share configuration in Solr. My hope was that someone who had used it successfully could indicate either something I missed about how to make it work, or a useful pattern for working within the limitations of the available functionality. Stephen Duncan Jr www.stephenduncanjr.com