1
我已經配置春季數據的Solr 1.5.4使用Apache Solr實現5.2.1,這是我的配置:Solr的NonRepeatableRequestException在保存操作
@Bean
public SolrTemplate solrTemplate() {
return new SolrTemplate(solrServerFactory());
}
@Bean
public SolrServerFactory solrServerFactory() {
UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(username, password);
return new HttpSolrServerFactory(solrServer(), "", credentials, "BASIC");
}
@Bean
public SolrServer solrServer() {
ModifiableSolrParams params = new ModifiableSolrParams();
params.set(HttpClientUtil.PROP_ALLOW_COMPRESSION, true);
params.set(HttpClientUtil.PROP_BASIC_AUTH_USER, username);
params.set(HttpClientUtil.PROP_BASIC_AUTH_PASS, password);
params.set(HttpClientUtil.PROP_CONNECTION_TIMEOUT, 12345);
params.set(HttpClientUtil.PROP_FOLLOW_REDIRECTS, true);
params.set(HttpClientUtil.PROP_MAX_CONNECTIONS, 22345);
params.set(HttpClientUtil.PROP_MAX_CONNECTIONS_PER_HOST, 32345);
params.set(HttpClientUtil.PROP_SO_TIMEOUT, 42345);
params.set(HttpClientUtil.PROP_USE_RETRY, false);
HttpClient httpClient = HttpClientUtil.createClient(params);
HttpSolrServer httpSolrServer = new HttpSolrServer("http://" + host + ":" + port + "/solr/", httpClient);
return httpSolrServer;
}
但是當我要保存的文件,此異常情況:
14:28:45,863 Caused by: org.apache.http.client.NonRepeatableRequestException: Cannot retry request with a non-repeatable request entity.
14:28:45,863 at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:660)
14:28:45,863 at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:486)
14:28:45,863 at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
請幫幫我。