Package org.springframework.context

Examples of org.springframework.context.ApplicationContextException


    if (contextClassName != null) {
      try {
        return ClassUtils.forName(contextClassName, ClassUtils.getDefaultClassLoader());
      }
      catch (ClassNotFoundException ex) {
        throw new ApplicationContextException(
            "Failed to load custom context class [" + contextClassName + "]", ex);
      }
    }
    else {
      contextClassName = defaultStrategies.getProperty(WebApplicationContext.class.getName());
      try {
        return ClassUtils.forName(contextClassName, ContextLoader.class.getClassLoader());
      }
      catch (ClassNotFoundException ex) {
        throw new ApplicationContextException(
            "Failed to load default context class [" + contextClassName + "]", ex);
      }
    }
  }
View Full Code Here


      Class<?> clazz = ClassUtils.forName(className, ClassUtils.getDefaultClassLoader());
      Assert.isAssignable(ApplicationContextInitializer.class, clazz);
      return (Class<ApplicationContextInitializer<ConfigurableApplicationContext>>) clazz;
    }
    catch (ClassNotFoundException ex) {
      throw new ApplicationContextException("Failed to load context initializer class [" + className + "]", 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

    try {
      Resource resource = getApplicationContext().getResource(url);
      return new StreamSource(resource.getInputStream(), resource.getURI().toASCIIString());
    }
    catch (IOException ex) {
      throw new ApplicationContextException("Can't load XSLT stylesheet from '" + url + "'", ex);
    }
  }
View Full Code Here

      return finallyInvoked;
    }

    public void doTest() throws Exception {
      try {
        throw new ApplicationContextException("foo");
      }
      catch (Exception ex) {
        catchInvoked = true;
        throw ex;
      }
View Full Code Here

      logger.debug("Portlet with name '" + getPortletName() +
          "' will try to create custom ApplicationContext context of class '" +
          contextClass.getName() + "'" + ", using parent context [" + parent + "]");
    }
    if (!ConfigurablePortletApplicationContext.class.isAssignableFrom(contextClass)) {
      throw new ApplicationContextException("Fatal initialization error in portlet with name '" + getPortletName() +
          "': custom ApplicationContext class [" + contextClass.getName() +
          "] is not of type ConfigurablePortletApplicationContext");
    }
    ConfigurablePortletApplicationContext pac =
        (ConfigurablePortletApplicationContext) BeanUtils.instantiateClass(contextClass);
View Full Code Here

      this.logger.debug("Servlet with name '" + getServletName() +
          "' will try to create custom WebApplicationContext context of class '" +
          contextClass.getName() + "'" + ", using parent context [" + parent + "]");
    }
    if (!ConfigurableWebApplicationContext.class.isAssignableFrom(contextClass)) {
      throw new ApplicationContextException(
          "Fatal initialization error in servlet with name '" + getServletName() +
          "': custom WebApplicationContext class [" + contextClass.getName() +
          "] is not of type ConfigurableWebApplicationContext");
    }
    ConfigurableWebApplicationContext wac =
View Full Code Here

      synchronized (this.beanFactoryMonitor) {
        this.beanFactory = beanFactory;
      }
    }
    catch (IOException ex) {
      throw new ApplicationContextException("I/O error parsing bean definition source for " + getDisplayName(), 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<String, JasperReport>(this.subReportUrls.size());
      for (Enumeration<?> urls = this.subReportUrls.propertyNames(); urls.hasMoreElements();) {
        String key = (String) urls.nextElement();
View Full Code Here

      }
      throw new IllegalArgumentException(
          "Report filename [" + filename + "] must end in either .jasper or .jrxml");
    }
    catch (IOException ex) {
      throw new ApplicationContextException(
          "Could not load JasperReports report from " + resource, ex);
    }
    catch (JRException ex) {
      throw new ApplicationContextException(
          "Could not parse JasperReports report from " + resource, 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.