Examples of ValidationErrorHandler


Examples of ch.entwine.weblounge.common.impl.util.xml.ValidationErrorHandler

      URL siteUrl = e.nextElement();

      logger.debug("Parsing site definition from bundle '{}'", bundleName);

      // Load and validate the site descriptor
      ValidationErrorHandler errorHandler = new ValidationErrorHandler(siteUrl);
      docBuilder.setErrorHandler(errorHandler);
      final Document siteXml = docBuilder.parse(siteUrl.openStream());
      if (errorHandler.hasErrors()) {
        logger.error("Errors found while validating site descriptor in bundle '{}'. Site is not loaded", bundleName);
        return;
      }

      // Start loading the site in a new thread in order to enable parallel
View Full Code Here

Examples of ch.entwine.weblounge.common.impl.util.xml.ValidationErrorHandler

    docBuilderFactory.setSchema(siteSchema);
    docBuilderFactory.setNamespaceAware(true);
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();

    // Validate and read the site descriptor
    ValidationErrorHandler errorHandler = new ValidationErrorHandler("site");
    docBuilder.setErrorHandler(errorHandler);
    Document doc = docBuilder.parse(siteXml);

    Site site = SiteImpl.fromXml(doc.getFirstChild());
    return site;
View Full Code Here

Examples of ch.entwine.weblounge.common.impl.util.xml.ValidationErrorHandler

        int endIndex = moduleXmlUrl.toExternalForm().lastIndexOf('/');
        URL moduleUrl = new URL(moduleXmlUrl.toExternalForm().substring(0, endIndex));
        logger.debug("Loading module '{}' for site '{}'", moduleXmlUrl, this);

        // Load and validate the module descriptor
        ValidationErrorHandler errorHandler = new ValidationErrorHandler(moduleXmlUrl);
        docBuilder.setErrorHandler(errorHandler);
        Document moduleXml = docBuilder.parse(moduleXmlUrl.openStream());
        if (errorHandler.hasErrors()) {
          logger.error("Errors found while validating module descriptor {}. Site '{}' is not loaded", moduleXml, this);
          throw new IllegalStateException("Errors found while validating module descriptor " + moduleXml);
        }

        // We need the module id even if the module initialization fails to log
View Full Code Here

Examples of ch.entwine.weblounge.common.impl.util.xml.ValidationErrorHandler

    while (entries != null && entries.hasMoreElements()) {
      URL entry = (URL) entries.nextElement();

      // Validate and read the module descriptor
      ValidationErrorHandler errorHandler = new ValidationErrorHandler(entry);
      DocumentBuilder docBuilder;

      try {
        docBuilder = docBuilderFactory.newDocumentBuilder();
        docBuilder.setErrorHandler(errorHandler);
        Document doc = docBuilder.parse(entry.openStream());
        if (errorHandler.hasErrors()) {
          logger.warn("Error parsing integration test {}: XML validation failed", entry);
          continue;
        }
        IntegrationTestGroup test = IntegrationTestParser.fromXml(doc.getFirstChild());
        test.setSite(this);
View Full Code Here

Examples of ch.entwine.weblounge.common.impl.util.xml.ValidationErrorHandler

    docBuilderFactory.setNamespaceAware(true);
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();

    // Validate and read the module descriptor
    URL testContext = this.getClass().getResource(testFile);
    ValidationErrorHandler errorHandler = new ValidationErrorHandler(testContext);
    docBuilder.setErrorHandler(errorHandler);
    Document doc = docBuilder.parse(testContext.openStream());
    assertFalse("Schema validation failed", errorHandler.hasErrors());

    module = ModuleImpl.fromXml(doc.getFirstChild());
    module.setSite(site);
  }
View Full Code Here

Examples of ch.entwine.weblounge.common.impl.util.xml.ValidationErrorHandler

    docBuilderFactory.setNamespaceAware(true);
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();

    // Validate and read the module descriptor
    URL testContext = IntegrationTestParserTest.class.getResource(testFile);
    ValidationErrorHandler errorHandler = new ValidationErrorHandler(testContext);
    docBuilder.setErrorHandler(errorHandler);
    Document doc = docBuilder.parse(testContext.openStream());
    assertFalse("Schema validation failed", errorHandler.hasErrors());

    // Finally, parse the test
    testGroup = IntegrationTestParser.fromXml(doc.getFirstChild());
    testCases = testGroup.getTestCases();
  }
View Full Code Here

Examples of com.sun.xml.internal.ws.developer.ValidationErrorHandler

    }

    private void doProcess(Packet packet) {
        getValidator().reset();
        Class<? extends ValidationErrorHandler> handlerClass = feature.getErrorHandler();
        ValidationErrorHandler handler;
        try {
            handler = handlerClass.newInstance();
        } catch(Exception e) {
            throw new WebServiceException(e);
        }
        handler.setPacket(packet);
        getValidator().setErrorHandler(handler);
        Message msg = packet.getMessage().copy();
        Source source = msg.readPayloadAsSource();
        try {
            // Validator javadoc allows ONLY SAX, and DOM Sources
View Full Code Here

Examples of com.sun.xml.internal.ws.developer.ValidationErrorHandler

    }

    protected void doProcess(Packet packet) throws SAXException {
        getValidator().reset();
        Class<? extends ValidationErrorHandler> handlerClass = feature.getErrorHandler();
        ValidationErrorHandler handler;
        try {
            handler = handlerClass.newInstance();
        } catch(Exception e) {
            throw new WebServiceException(e);
        }
        handler.setPacket(packet);
        getValidator().setErrorHandler(handler);
        Message msg = packet.getMessage().copy();
        Source source = msg.readPayloadAsSource();
        try {
            // Validator javadoc allows ONLY SAX, and DOM Sources
View Full Code Here

Examples of com.sun.xml.ws.developer.ValidationErrorHandler


    protected void doProcess(Packet packet) throws SAXException {
        getValidator().reset();
        Class<? extends ValidationErrorHandler> handlerClass = feature.getErrorHandler();
        ValidationErrorHandler handler;
        try {
            handler = handlerClass.newInstance();
        } catch(Exception e) {
            throw new WebServiceException(e);
        }
        handler.setPacket(packet);
        getValidator().setErrorHandler(handler);
        Message msg = packet.getMessage().copy();
        Source source = msg.readPayloadAsSource();
        try {
            // Validator javadoc allows ONLY SAX, and DOM Sources
View Full Code Here

Examples of com.sun.xml.ws.developer.ValidationErrorHandler

    }

    protected void doProcess(Packet packet) throws SAXException {
        getValidator().reset();
        Class<? extends ValidationErrorHandler> handlerClass = feature.getErrorHandler();
        ValidationErrorHandler handler;
        try {
            handler = handlerClass.newInstance();
        } catch(Exception e) {
            throw new WebServiceException(e);
        }
        handler.setPacket(packet);
        getValidator().setErrorHandler(handler);
        Message msg = packet.getMessage().copy();
        Source source = msg.readPayloadAsSource();
        try {
            // Validator javadoc allows ONLY SAX, and DOM Sources
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.