Package org.springframework.context

Examples of org.springframework.context.ApplicationContextException


          BeanFactoryUtils.beanOfTypeIncludingAncestors(
              getApplicationContext(), VelocityConfig.class, true, false);
      return velocityConfig.getVelocityEngine();
    }
    catch (NoSuchBeanDefinitionException ex) {
      throw new ApplicationContextException(
          "Must define a single VelocityConfig bean in this web application context " +
          "(may be inherited): VelocityConfigurer is the usual implementation. " +
          "This bean may be given any name.", ex);
    }
  }
View Full Code Here


    try {
      // Check that we can get the template, even if we might subsequently get it again.
      this.template = getTemplate();
    }
    catch (ResourceNotFoundException ex) {
      throw new ApplicationContextException("Cannot find Velocity template for URL [" + getUrl() +
        "]: Did you specify the correct resource loader path?", ex);
    }
    catch (Exception ex) {
      throw new ApplicationContextException(
          "Could not load Velocity template for URL [" + getUrl() + "]", ex);
    }
  }
View Full Code Here

        logger.debug("Loading templates '" + templates + "'");
      }
      return templates;
    }
    catch (TransformerConfigurationException ex) {
      throw new ApplicationContextException("Can't load stylesheet from '" + getUrl() + "'", ex);
    }
    finally {
      closeSourceIfNecessary(stylesheetSource);
    }
  }
View Full Code Here

      Resource stylesheetResource = getApplicationContext().getResource(url);
      String systemId = url.substring(0, url.lastIndexOf('/') + 1);
      return new StreamSource(stylesheetResource.getInputStream(), systemId);
    }
    catch (IOException ex) {
      throw new ApplicationContextException("Can't load XSLT stylesheet from '" + url + "'", ex);
    }
  }
View Full Code Here

    this.report = loadReport();

    // Load sub reports if required, and check data source parameters.
    if (this.subReportUrls != null) {
      if (this.subReportDataKeys != null && this.subReportDataKeys.length > 0 && this.reportDataKey == null) {
        throw new ApplicationContextException(
            "'reportDataKey' for main report is required when specifying a value for 'subReportDataKeys'");
      }
      this.subReports = new HashMap(this.subReportUrls.size());
      for (Enumeration urls = this.subReportUrls.propertyNames(); urls.hasMoreElements();) {
        String key = (String) urls.nextElement();
View Full Code Here

        throw new IllegalArgumentException(
            "Report URL [" + getUrl() + "] must end in either .jasper or .jrxml");
      }
    }
    catch (IOException ex) {
      throw new ApplicationContextException(
          "Could not load JasperReports report for URL [" + getUrl() + "]", ex);
    }
    catch (JRException ex) {
      throw new ApplicationContextException(
          "Could not parse JasperReports report for URL [" + getUrl() + "]", ex);
    }
  }
View Full Code Here

    }
    try {
      getTemplates();
    }
    catch (TransformerConfigurationException ex) {
      throw new ApplicationContextException("Cannot load stylesheet for XSLT view '" + getBeanName() + "'", ex);
    }
  }
View Full Code Here

      String urlPath = url.toString();
      String systemId = urlPath.substring(0, urlPath.lastIndexOf('/') + 1);
      return new StreamSource(url.openStream(), systemId);
    }
    catch (IOException ex) {
      throw new ApplicationContextException("Can't load XSLT stylesheet from " + stylesheetLocation, ex);
    }
  }
View Full Code Here

    try {
      return (FreeMarkerConfig) BeanFactoryUtils.beanOfTypeIncludingAncestors(
          getApplicationContext(), FreeMarkerConfig.class, true, false);
    }
    catch (NoSuchBeanDefinitionException ex) {
      throw new ApplicationContextException(
          "Must define a single FreeMarkerConfig bean in this web application context " +
          "(may be inherited): FreeMarkerConfigurer is the usual implementation. " +
          "This bean may be given any name.", ex);
    }
  }
View Full Code Here

    try {
      // Check that we can get the template, even if we might subsequently get it again.
      getTemplate(getConfiguration().getLocale());
    }
    catch (ParseException ex) {
      throw new ApplicationContextException(
          "Failed to parse FreeMarker template for URL [" +  getUrl() + "]", ex);
    }
    catch (IOException ex) {
      throw new ApplicationContextException(
          "Could not load FreeMarker template for URL [" + getUrl() + "]", ex);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.context.ApplicationContextException

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.