Changeset 32419 for gs3-extensions

Show
Ignore:
Timestamp:
03.09.2018 16:08:35 (14 months ago)
Author:
ak19
Message:

ProtocolPortProperties?.java constructors can throw an Exception now.

Location:
gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/GS2SolrSearch.java

    r32411 r32419  
    9999            //String port = globalProperties.getProperty("tomcat.port.http", "8383"); 
    100100            //String protocol = globalProperties.getProperty("server.protocol", "http"); 
    101             ProtocolPortProperties protocolPortProps = new ProtocolPortProperties(globalProperties); 
    102             if(protocolPortProps.hadError()) { 
    103             throw new Exception("**** ERROR with port and/or protocol in build.properties:\n" + protocolPortProps.getErrorMsg()); 
    104             } 
     101            ProtocolPortProperties protocolPortProps = new ProtocolPortProperties(globalProperties); // can throw Exception 
     102             
    105103            String protocol = protocolPortProps.getProtocol(); 
    106104            String port = protocolPortProps.getPort(); 
     
    126124        } 
    127125         
     126        if(solr_servlet_base_url == null) { 
     127            logger.error("Unable to configure GS2SolrSearch - solr_servlet_base_url is null because of issues with port/protocol in global.properties"); 
     128            return false; 
     129        } 
     130             
    128131        // Setting up facets 
    129132 
  • gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/SolrSearch.java

    r32411 r32419  
    4949        //String port = globalProperties.getProperty("tomcat.port.http", "8383"); 
    5050        //String protocol = globalProperties.getProperty("server.protocol", "http"); 
    51         ProtocolPortProperties protocolPortProps = new ProtocolPortProperties(globalProperties); 
    52         if(protocolPortProps.hadError()) { 
    53         throw new Exception("**** ERROR with port and/or protocol in build.properties:\n" + protocolPortProps.getErrorMsg()); 
    54         } 
     51        ProtocolPortProperties protocolPortProps = new ProtocolPortProperties(globalProperties); // can throw an Exception       
    5552        String protocol = protocolPortProps.getProtocol(); 
    5653        String port = protocolPortProps.getPort(); 
     
    8885        return false; 
    8986    } 
    90  
     87     
     88    if(solr_servlet_base_url == null) { 
     89        logger.error("Unable to configure SolrSearch - solr_servlet_base_url is null because of issues with port/protocol in global.properties"); 
     90        return false; 
     91    } 
    9192    // initialize required number of SolrCores based on values 
    9293    // in 'index_ids' that are set by LuceneSearch::configure()