mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 10:04:21 +00:00
Minor refactor to make it easier to debug OAI Solr connection problems. Update to new config format
This commit is contained in:
@@ -26,11 +26,12 @@ public class DSpaceSolrServerResolver implements SolrServerResolver {
|
||||
@Override
|
||||
public SolrClient getServer() throws SolrServerException {
|
||||
if (server == null) {
|
||||
String serverUrl = configurationService.getProperty("oai.solr.url");
|
||||
try {
|
||||
server = new HttpSolrClient.Builder(configurationService.getProperty("oai", "solr.url")).build();
|
||||
log.debug("Solr Server Initialized");
|
||||
server = new HttpSolrClient.Builder(serverUrl).build();
|
||||
log.debug("OAI Solr Server Initialized");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
log.error("Could not initialize OAI Solr Server at " + serverUrl , e);
|
||||
}
|
||||
}
|
||||
return server;
|
||||
|
@@ -30,12 +30,12 @@ public class DSpaceSolrServer {
|
||||
|
||||
public static SolrClient getServer() throws SolrServerException {
|
||||
if (_server == null) {
|
||||
String serverUrl = ConfigurationManager.getProperty("oai.solr.url");
|
||||
try {
|
||||
_server = new HttpSolrClient.Builder(
|
||||
ConfigurationManager.getProperty("oai", "solr.url")).build();
|
||||
log.debug("Solr Server Initialized");
|
||||
_server = new HttpSolrClient.Builder(serverUrl).build();
|
||||
log.debug("OAI Solr Server Initialized");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
log.error("Could not initialize OAI Solr Server at " + serverUrl , e);
|
||||
}
|
||||
}
|
||||
return _server;
|
||||
|
Reference in New Issue
Block a user