【发布时间】:2025-11-21 14:35:01
【问题描述】:
我在将 spring data solr 连接到在 openshift 上运行的 solr 时遇到问题。
<solr:solr-server id="solrServer"
url="http://solr-dashapramathi.rhcloud.com/" />
<bean id="solrTemplate" class="org.springframework.data.solr.core.SolrTemplate"
scope="singleton">
<constructor-arg ref="solrServer" />
</bean>
是我的配置。我还尝试将 url 设为“http://solr-dashapramathi.rhcloud.com/#/dashapramathi”我在 openshift 上运行 Solr 4.10.1。
错误如下:
IOException occured when talking to server at: http://solr-dashapramathi.rhcloud.com/dashapramathi; nested exception is org.apache.solr.client.solrj.SolrServerException: IOException occured when talking to server at: http://solr-dashapramathi.rhcloud.com/dashapramathi
原因:
org.springframework.data.solr.UncategorizedSolrException: 与服务器交谈时发生 IOException:http://solr-dashapramathi.rhcloud.com/dashapramathi;嵌套异常是 org.apache.solr.client.solrj.SolrServerException: 与服务器交谈时发生 IOException:http://solr-dashapramathi.rhcloud.com/dashapramathi 在 org.springframework.data.solr.core.SolrTemplate.execute(SolrTemplate.java:136) 在 org.springframework.data.solr.core.SolrTemplate.saveBean(SolrTemplate.java:175) 在 org.springframework.data.solr.core.SolrTemplate.saveBean(SolrTemplate.java:169) 在 org.springframework.data.solr.repository.support.SimpleSolrRepository.save(SimpleSolrRepository.java:149)
原因:org.apache.http.conn.ConnectTimeoutException: Connect to solr-dashapramathi.rhcloud.com:80 timed out 在 org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:129)
谁能帮帮我?
【问题讨论】:
-
当我在本地系统中运行 Solr 时,它按预期工作。