1

インデックスを実行すると、次のエラーが発生します。Solr1.4を使用しています。私は1日以来、この根本的な原因を知るのに苦労してきましたが、できませんでした. これを解決するのを手伝ってください。

Caused by: org.apache.solr.client.solrj.SolrServerException:
org.apache.commons.httpclient.ProtocolException: Unbuffered entity enclosing request can not be repeated.at 
org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:469) at
org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:243) at
org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:105) at       
org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:49)
 ... 3 more
Caused by: org.apache.commons.httpclient.ProtocolException: Unbuffered entity enclosing request can not be repeated.     at
org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:487)     at
org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)     at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)     at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)     at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)     at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)     at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)     at
org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:416)
... 7 more

コードは次のとおりです。

Collection<SolrInputDocument> docs = new ArrayList<SolrInputDocument>();

CommonsHttpSolrServer server = new CommonsHttpSolrServer(solrHost);
server.setDefaultMaxConnectionsPerHost(150);
server.setRequestWriter(new BinaryRequestWriter());

SolrInputDocument solrDoc = new SolrInputDocument();
solrDoc.addField("id", "1234");
docs.add(solrDoc);

try {
   server.add(docs);
   server.commit();
} catch (SolrServerException e) {
   throw new SolrException(e.getMessage());
}
4

0 に答える 0