if( XmlLibraryChecker.isXalanVersionOK() ){ LOG.info("Detected "+ XmlLibraryChecker.XALANVERSION + ", OK.");  } else { LOG.warn("eXist requires '"+ XmlLibraryChecker.XALANVERSION + "' but detected '"+ XmlLibraryChecker.getXalanVersion() +"'. Please add the correct version to the " +"class-path, e.g. in the 'endorsed' folder of " +"the servlet container or in the 'endorsed' folder " +"of the JRE."); }
	public void init(ServletConfig config) throws ServletException {		super.init(config);				// Configure BrokerPool		try {			if (BrokerPool.isConfigured()) {				LOG.info("Database already started. Skipping configuration ...");			} else {				String confFile = config.getInitParameter("configuration");				String dbHome = config.getInitParameter("basedir");				String start = config.getInitParameter("start");					if (confFile == null)					confFile = "conf.xml";				dbHome = (dbHome == null) ? config.getServletContext().getRealPath(						".") : config.getServletContext().getRealPath(dbHome);				LOG.info("EXistServlet: exist.home=" + dbHome);				System.setProperty("exist.home", dbHome);								File f = new File(dbHome + File.separator + confFile);				LOG.info("reading configuration from " + f.getAbsolutePath());				if (!f.canRead())					throw new ServletException("configuration file " + confFile							+ " not found or not readable");				Configuration configuration = new Configuration(confFile, dbHome);				if (start != null && start.equals("true"))					startup(configuration);			}			pool = BrokerPool.getInstance();			String option = config.getInitParameter("use-default-user");                        boolean useDefaultUser = true;			if (option != null) {                           useDefaultUser = option.trim().equals("true");                        }                        if (useDefaultUser) {                           option = config.getInitParameter("user");                           if (option != null)                                   defaultUsername = option;                           option = config.getInitParameter("password");                           if (option != null)                                   defaultPassword = option;                           defaultUser = getDefaultUser();                           if (defaultUser!=null) {                              LOG.info("Using default user "+defaultUsername+" for all unauthorized requests.");                           } else {                              LOG.error("Default user "+defaultUsername+" cannot be found.  A BASIC AUTH challenge will be the default.");                           }                        } else {                           LOG.info("No default user.  All requires must be authorized or will result in a BASIC AUTH challenge.");                           defaultUser = null;                        }                        authenticator = new BasicAuthenticator(pool);		} catch (EXistException e) {			throw new ServletException("No database instance available");		} catch (DatabaseConfigurationException e) {			throw new ServletException("Unable to configure database instance: " + e.getMessage(), e);		}				//get form and container encoding's		formEncoding = config.getInitParameter("form-encoding");		if(formEncoding == null)			formEncoding = DEFAULT_ENCODING;		String containerEncoding = config.getInitParameter("container-encoding");		if(containerEncoding == null)			containerEncoding = DEFAULT_ENCODING;				//Instantiate REST Server		srvREST = new RESTServer(formEncoding, containerEncoding);                		//Instantiate SOAP Server		srvSOAP = new SOAPServer(formEncoding, containerEncoding);				                // XML lib checks....                if( XmlLibraryChecker.isXercesVersionOK() ){                    LOG.info("Detected "+ XmlLibraryChecker.XERCESVERSION + ", OK.");                                    } else {                    LOG.warn("eXist requires '"+ XmlLibraryChecker.XERCESVERSION                             + "' but detected '"+ XmlLibraryChecker.getXercesVersion()                            +"'. Please add the correct version to the "                            +"class-path, e.g. in the 'endorsed' folder of "                             +"the servlet container or in the 'endorsed' folder "                            +"of the JRE.");                }//                if( XmlLibraryChecker.isSaxonVersionOK() ){//                    LOG.info("Detected "+ XmlLibraryChecker.SAXONVERSION+ ", OK.");//                    //                } else {//                    LOG.warn("eXist requires '"+ XmlLibraryChecker.SAXONVERSION //                            + "' but detected '"+ XmlLibraryChecker.getSaxonVersion()//                            +"'. Please add the correct version to the "//                            +"class-path, e.g. in the 'endorsed' folder of " //                            +"the servlet container or in the 'endorsed' folder "//                            +"of the JRE.");//                }	}