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
|
@Override
|
||||||
public SolrClient getServer() throws SolrServerException {
|
public SolrClient getServer() throws SolrServerException {
|
||||||
if (server == null) {
|
if (server == null) {
|
||||||
|
String serverUrl = configurationService.getProperty("oai.solr.url");
|
||||||
try {
|
try {
|
||||||
server = new HttpSolrClient.Builder(configurationService.getProperty("oai", "solr.url")).build();
|
server = new HttpSolrClient.Builder(serverUrl).build();
|
||||||
log.debug("Solr Server Initialized");
|
log.debug("OAI Solr Server Initialized");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error("Could not initialize OAI Solr Server at " + serverUrl , e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return server;
|
return server;
|
||||||
|
@@ -30,12 +30,12 @@ public class DSpaceSolrServer {
|
|||||||
|
|
||||||
public static SolrClient getServer() throws SolrServerException {
|
public static SolrClient getServer() throws SolrServerException {
|
||||||
if (_server == null) {
|
if (_server == null) {
|
||||||
|
String serverUrl = ConfigurationManager.getProperty("oai.solr.url");
|
||||||
try {
|
try {
|
||||||
_server = new HttpSolrClient.Builder(
|
_server = new HttpSolrClient.Builder(serverUrl).build();
|
||||||
ConfigurationManager.getProperty("oai", "solr.url")).build();
|
log.debug("OAI Solr Server Initialized");
|
||||||
log.debug("Solr Server Initialized");
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error("Could not initialize OAI Solr Server at " + serverUrl , e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return _server;
|
return _server;
|
||||||
|
Reference in New Issue
Block a user