	public CapoApplication() throws Exception
	{
	    setApplication(this);		
		System.setProperty("java.util.prefs.syncInterval", "2000000");
		System.setProperty("javax.xml.xpath.XPathFactory", "net.sf.saxon.xpath.XPathFactoryImpl");
		System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl");
		System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "com.delcyon.capo.xml.cdom.CDocumentBuilderFactory");
		System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true");
		System.setProperty("sun.security.ssl.allowLegacyHelloMessages", "true");
		if (logger == null)
		{
			logger = Logger.getLogger(this.getClass().getName());
			logger.setLevel(LOGGING_LEVEL);
			if (logger.getHandlers().length == 0) 
			{
				if (leveledConsoleHandler == null)
				{
					leveledConsoleHandler = new LeveledConsoleHandler();
					leveledConsoleHandler.setLevel(LOGGING_LEVEL);
					leveledConsoleHandler.setOutputForLevel(Output.STDERR, Level.FINER);
					leveledConsoleHandler.setFormatter(new LogPrefixFormatter(getApplication().getApplicationDirectoryName().toUpperCase()+": "));
					logger.setUseParentHandlers(false);
					logger.addHandler(leveledConsoleHandler);				
				}
				if (fileHandler == null)
				{
					logFileName = getApplication().getApplicationDirectoryName().replaceAll(" ", "_").toLowerCase() + ".log";
					logger.log(Level.FINE, "Opening LogElement File:" + logFileName);
					fileHandler = new FileHandler(logFileName);
					fileHandler.setLevel(LOGGING_LEVEL);
					logger.addHandler(fileHandler);
				}
			}
		}
		logger.log(Level.INFO, "Starting Capo "+getApplication().getApplicationDirectoryName());
		MimeUtil.registerMimeDetector("eu.medsea.mimeutil.detector.MagicMimeMimeDetector");
		MimeUtil.registerMimeDetector("eu.medsea.mimeutil.detector.ExtensionMimeDetector");
		documentBuilderFactory = DocumentBuilderFactory.newInstance();
		documentBuilderFactory.setNamespaceAware(true);
		TransformerFactory tFactory = TransformerFactory.newInstance();
		transformer = tFactory.newTransformer();
		transformer.setOutputProperty(OutputKeys.INDENT, "yes");
		URL[] urls = ClasspathUrlFinder.findClassPaths();
		AnnotationDB annotationDB = new AnnotationDB();
		annotationDB.scanArchives(urls);
		annotaionMap = annotationDB.getAnnotationIndex();
		XPath.setXPathFunctionResolver(new CapoXPathFunctionResolver());
	}

	public CapoApplication() throws Exception
	{
	    setApplication(this);		
		System.setProperty("java.util.prefs.syncInterval", "2000000");
		System.setProperty("javax.xml.xpath.XPathFactory", "net.sf.saxon.xpath.XPathFactoryImpl");
		System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl");
		System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "com.delcyon.capo.xml.cdom.CDocumentBuilderFactory");
		System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true");
		System.setProperty("sun.security.ssl.allowLegacyHelloMessages", "true");
		System.setProperty("hsqldb.reconfig_logging", "false"); 
		if (logger == null)
		{
			logger = Logger.getLogger(this.getClass().getName());
			logger.setLevel(LOGGING_LEVEL);
			if (logger.getHandlers().length == 0) 
			{
				if (leveledConsoleHandler == null)
				{
					leveledConsoleHandler = new LeveledConsoleHandler();
					leveledConsoleHandler.setLevel(LOGGING_LEVEL);
					leveledConsoleHandler.setOutputForLevel(Output.STDERR, Level.FINER);
					leveledConsoleHandler.setFormatter(new LogPrefixFormatter(getApplication().getApplicationDirectoryName().toUpperCase()+": "));
					logger.setUseParentHandlers(false);
					logger.addHandler(leveledConsoleHandler);				
				}
				if (fileHandler == null)
				{
					logFileName = getApplication().getApplicationDirectoryName().replaceAll(" ", "_").toLowerCase() + ".log";
					logger.log(Level.FINE, "Opening LogElement File:" + logFileName);
					fileHandler = new FileHandler(logFileName);
					fileHandler.setLevel(LOGGING_LEVEL);
					logger.addHandler(fileHandler);
				}
			}
		}
		logger.log(Level.INFO, "Starting Capo "+getApplication().getApplicationDirectoryName());
		MimeUtil.registerMimeDetector("eu.medsea.mimeutil.detector.MagicMimeMimeDetector");
		MimeUtil.registerMimeDetector("eu.medsea.mimeutil.detector.ExtensionMimeDetector");
		documentBuilderFactory = DocumentBuilderFactory.newInstance();
		documentBuilderFactory.setNamespaceAware(true);
		TransformerFactory tFactory = TransformerFactory.newInstance();
		transformer = tFactory.newTransformer();
		transformer.setOutputProperty(OutputKeys.INDENT, "yes");
		URL[] urls = ClasspathUrlFinder.findClassPaths();
		AnnotationDB annotationDB = new AnnotationDB();
		annotationDB.scanArchives(urls);
		annotaionMap = annotationDB.getAnnotationIndex();
		XPath.setXPathFunctionResolver(new CapoXPathFunctionResolver());
	}
