try {
idpConfig = Parser.loadDom(configFileLocation, true);
+
+ if (idpConfig == null) { throw new Exception("IdP configuration could not be loaded from (" + idpConfigFile
+ + ")."); }
+
if (log.isDebugEnabled()) {
log.debug("IdP configuration file " + configFileLocation + " successfully read and cached.");
}
} catch (Exception e) {
- log.error("Encountered an error while parsing Shibboleth Identity Provider configuration file: " + e);
- throw new ShibbolethConfigurationException("Unable to parse IdP configuration file.");
+ throw new ShibbolethConfigurationException(
+ "Encountered an error while parsing Shibboleth Identity Provider configuration file: " + e);
}
return idpConfig;
}
import java.util.Random;
import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.UnavailableException;
import javax.servlet.http.HttpServlet;
/*
* @see javax.servlet.GenericServlet#init()
*/
- public void init() throws ServletException {
+ public void init(ServletConfig servletConfig) throws ServletException {
- super.init();
+ super.init(servletConfig);
try {
binding = SAMLBindingFactory.getInstance(SAMLBinding.SOAP);
"Logging");
if (itemElements.getLength() > 0) {
if (itemElements.getLength() > 1) {
- System.err
- .println("WARNING: More than one Logging element in IdP configuration, using the first one.");
+ System.err.println("WARNING: More than one Logging element in IdP configuration, "
+ + "using the first one.");
} else {
Element loggingConfig = (Element) itemElements.item(0);
LoggingInitializer.initializeLogging(loggingConfig);
log.info("Identity Provider initialization complete.");
} catch (ShibbolethConfigurationException ae) {
- log.fatal("The Identity Provider could not be initialized: " + ae);
+ servletConfig.getServletContext().log("The Identity Provider could not be initialized: " + ae);
+ if (log != null) {
+ log.fatal("The Identity Provider could not be initialized: " + ae);
+ }
throw new UnavailableException("Identity Provider failed to initialize.");
} catch (SAMLException se) {
log.fatal("SAML SOAP binding could not be loaded: " + se);