Package org.apache.log4j.xml

Examples of org.apache.log4j.xml.Log4jEntityResolver


        try
        {
            docFactory.setValidating(true);
            docBuilder = docFactory.newDocumentBuilder();
            docBuilder.setErrorHandler(errHandler);
            docBuilder.setEntityResolver(new Log4jEntityResolver());
            doc = docBuilder.parse(fileName);
        }
        catch (ParserConfigurationException e)
        {
            LOGGER.warn("Unable to parse the log4j XML file due to possible configuration error: ", e);
View Full Code Here


    joranInterpreter = new Interpreter(rs);

    // We need to bother with an entity resolver in order to be compatible
    // with config files written for DOMConfigurator containing the following:
    // <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    joranInterpreter.setEntityResolver(new Log4jEntityResolver());

    // The following line adds the capability to parse nested components
    joranInterpreter.addImplcitAction(new NestComponentIA());
    ExecutionContext ec = joranInterpreter.getExecutionContext();
View Full Code Here

      SAXParserFactory spf = SAXParserFactory.newInstance();
      spf.setValidating(false);
      SAXParser saxParser = spf.newSAXParser();

      WellfomednessChecker wc = new WellfomednessChecker(errorList);
      wc.setEntityResolver(new Log4jEntityResolver());
     
      saxParser.parse(inputSource, wc);
      result = WELL_FORMED;     
    } catch(org.xml.sax.SAXParseException se) {
      result = ILL_FORMED;
View Full Code Here

        try
        {
            docFactory.setValidating(true);
            docBuilder = docFactory.newDocumentBuilder();
            docBuilder.setErrorHandler(errHandler);
            docBuilder.setEntityResolver(new Log4jEntityResolver());
            doc = docBuilder.parse(fileName);
        }
        catch (ParserConfigurationException e)
        {
            _logger.warn("Unable to parse the log4j XML file due to possible configuration error: " + e);
View Full Code Here

            try
            {
                docFactory.setValidating(true);
                docBuilder = docFactory.newDocumentBuilder();
                docBuilder.setErrorHandler(errHandler);
                docBuilder.setEntityResolver(new Log4jEntityResolver());
                doc = docBuilder.parse(fileName);
            }
            catch (ParserConfigurationException e)
            {
                _logger.warn("Unable to parse the log4j XML file due to possible configuration error: " + e);
View Full Code Here

        try
        {
            docFactory.setValidating(true);
            docBuilder = docFactory.newDocumentBuilder();
            docBuilder.setErrorHandler(errHandler);
            docBuilder.setEntityResolver(new Log4jEntityResolver());
            doc = docBuilder.parse(fileName);
        }
        catch (ParserConfigurationException e)
        {
            LOGGER.warn("Unable to parse the log4j XML file due to possible configuration error: ", e);
View Full Code Here

        throw new FileNotFoundException(
                "Could not find resource " + resourceName);
    }
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
  builder.setEntityResolver(new Log4jEntityResolver());
    Document doc = builder.parse(is);
    DOMConfigurator.configure(doc.getDocumentElement());
  }
View Full Code Here

          throw new FileNotFoundException(
                  "Could not find resource " + resourceName);
      }
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder builder = factory.newDocumentBuilder();
      builder.setEntityResolver(new Log4jEntityResolver());
      Document doc = builder.parse(is);
      DOMConfigurator.configure(doc.getDocumentElement());
    }
View Full Code Here

        try
        {
            docFactory.setValidating(true);
            docBuilder = docFactory.newDocumentBuilder();
            docBuilder.setErrorHandler(errHandler);
            docBuilder.setEntityResolver(new Log4jEntityResolver());
            doc = docBuilder.parse(fileName);
        }
        catch (ParserConfigurationException e)
        {
            LOGGER.warn("Unable to parse the log4j XML file due to possible configuration error: ", e);
View Full Code Here

        } catch (ParserConfigurationException e) {
            this.logger.fatal(e.getMessage(), e);
            throw new RuntimeException(e);
        }
        this.docBuilder.setErrorHandler(new DefaultHandler());
        this.docBuilder.setEntityResolver(new Log4jEntityResolver());
    }
View Full Code Here

TOP

Related Classes of org.apache.log4j.xml.Log4jEntityResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.