GitHub user acmcelwee opened a pull request:
https://github.com/apache/lucene-solr/pull/147
Fix invalid solr.xml creation in SolrOutputFormat.java
Sometime after Solr 4.9, the `MapReduceIndexerTool` got busted because
invalid `solr.xml` contents were being written to the solr home dir zip. My
guess is that a 5.0 change made the invalid file start to matter.
The error manifests as:
```java
Error: java.lang.IllegalStateException: Failed to initialize record writer
for org.apache.solr.hadoop.MapReduceIndexerTool/SolrMapper,
attempt_1430953999892_0012_r_000001_1
at
org.apache.solr.hadoop.SolrRecordWriter.<init>(SolrRecordWriter.java:126)
at
org.apache.solr.hadoop.SolrOutputFormat.getRecordWriter(SolrOutputFormat.java:163)
at
org.apache.hadoop.mapred.ReduceTask$NewTrackingRecordWriter.<init>(ReduceTask.java:569)
at
org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:643)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:394)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:175)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1548)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:170)
Caused by: org.apache.solr.common.SolrException:
org.xml.sax.SAXParseException; Premature end of file.
at org.apache.solr.core.Config.<init>(Config.java:156)
at
org.apache.solr.core.SolrXmlConfig.fromInputStream(SolrXmlConfig.java:127)
at
org.apache.solr.core.SolrXmlConfig.fromFile(SolrXmlConfig.java:110)
at
org.apache.solr.core.SolrXmlConfig.fromSolrHome(SolrXmlConfig.java:138)
at org.apache.solr.core.CoreContainer.<init>(CoreContainer.java:142)
at
org.apache.solr.hadoop.SolrRecordWriter.createEmbeddedSolrServer(SolrRecordWriter.java:162)
at
org.apache.solr.hadoop.SolrRecordWriter.<init>(SolrRecordWriter.java:119)
... 9 more
Caused by: org.xml.sax.SAXParseException; Premature end of file.
at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown
Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
at
org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.apache.solr.core.Config.<init>(Config.java:145)
... 15 more
```
The last version that I've successfully used `MapReduceIndexerTool` was
4.9, and I verified that this patch resolves the issue for me (testing on 5.1).
I spent a couple hours trying to write a simple test case to exhibit the error,
but I haven't quite figured out how to deal with the
`java.security.AccessControlException: java.io.FilePermission ...` errors.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/acmcelwee/lucene-solr map-reduce_solr-xml
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/lucene-solr/pull/147.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #147
----
commit 85e1348ffdb85e36997e963ee9aa662e022412c2
Author: Adam McElwee <[email protected]>
Date: 2015-05-07T23:17:07Z
Fix invalid solr.xml creation in SolrOutputFormat.java
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]