Changeset 32419 for main/trunk
- Timestamp:
- 2018-09-03T16:08:35+12:00 (6 years ago)
- Location:
- main/trunk/greenstone3/src/java/org/greenstone
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/FedoraServiceProxy.java
r32357 r32419 142 142 Properties globalProperties = new Properties(); 143 143 globalProperties.load(Class.forName("org.greenstone.util.GlobalProperties").getClassLoader().getResourceAsStream("global.properties")); 144 145 ProtocolPortProperties protocolPortProps = new ProtocolPortProperties(globalProperties); // can throw Exception 144 146 String host = globalProperties.getProperty("tomcat.server", "localhost"); 145 ProtocolPortProperties protocolPortProps = new ProtocolPortProperties(globalProperties);146 if(protocolPortProps.hadError()) {147 logger.error("Error with port/protocol in global.properties: " + protocolPortProps.getErrorMsg());148 return false; // configure has failed149 }150 147 String protocol = protocolPortProps.getProtocol(); 151 148 String port = protocolPortProps.getPort(); … … 185 182 } catch(Exception e) { 186 183 logger.error("Error instantiating the interface to the Fedora Repository:\n", e); // second parameter prints e's stacktrace 187 return false; 184 return false; // configure has failed 188 185 } 189 186 -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/ServletRealmCheck.java
r32357 r32419 88 88 // get the property value and print it out 89 89 String servername = buildProps.getProperty("tomcat.server"); 90 //String protocol = buildProps.getProperty("server.protocol", "http"); 91 //String port = buildProps.getProperty("tomcat.port"+protocol, "8383"); 92 93 ProtocolPortProperties protocolPortProps = new ProtocolPortProperties(buildProps); 94 if(protocolPortProps.hadError()) { 95 throw new Exception("**** ERROR with port and/or protocol in build.properties:\n" + protocolPortProps.getErrorMsg()); 96 } 90 ProtocolPortProperties protocolPortProps = new ProtocolPortProperties(buildProps); // can throw Exception 97 91 String protocol = protocolPortProps.getProtocol(); 98 92 String port = protocolPortProps.getPort(); -
main/trunk/greenstone3/src/java/org/greenstone/server/Server3.java
r32357 r32419 25 25 // config properties are loaded into the config_properties object 26 26 // now test the port and protocol values are sane or exit. 27 protocolPortProps = new ProtocolPortProperties(config_properties); 28 if(protocolPortProps.hadError()) { 27 try { 28 protocolPortProps = new ProtocolPortProperties(config_properties); 29 } catch(Exception e) { 29 30 String errorMsg = "Error with port/protocol in " + config_properties_file + ": " + protocolPortProps.getErrorMsg(); 30 31 … … 34 35 // If error, then quit this app as soon as possible 35 36 System.exit(-1); 36 } 37 } 37 38 38 39 Property = protocolPortProps.legacyMode ? new Server3Property() : new Server3Property(protocolPortProps.getProtocol()); -
main/trunk/greenstone3/src/java/org/greenstone/util/ProtocolPortProperties.java
r32418 r32419 66 66 // Won't attempt to recover on error. 67 67 // This means on error, port etc values will be invalid 68 public ProtocolPortProperties(Properties props) {68 public ProtocolPortProperties(Properties props) throws Exception { 69 69 this(props, false); 70 70 } 71 71 72 public ProtocolPortProperties(Properties props, boolean recover) 72 public ProtocolPortProperties(Properties props, boolean recover) throws Exception 73 73 { 74 74 StringBuffer msg = new StringBuffer(); … … 215 215 216 216 errorMsg = msg.toString(); 217 218 if(!recover && errorCode != ALL_CORRECT) { 219 throw new Exception(errorMsg); 220 } 217 221 } 218 222
Note:
See TracChangeset
for help on using the changeset viewer.