Package org.springframework.context

Examples of org.springframework.context.ApplicationContextException


      logger.debug("ContextLoaderPlugIn for Struts ActionServlet '" + getServletName() +
          "', module '" + getModulePrefix() + "' will try to create custom WebApplicationContext " +
          "context of class '" + getContextClass().getName() + "', using parent context [" + parent + "]");
    }
    if (!ConfigurableWebApplicationContext.class.isAssignableFrom(getContextClass())) {
      throw new ApplicationContextException(
          "Fatal initialization error in ContextLoaderPlugIn for Struts ActionServlet '" + getServletName() +
          "', module '" + getModulePrefix() + "': custom WebApplicationContext class [" +
          getContextClass().getName() + "] is not of type ConfigurableWebApplicationContext");
    }
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

    // get definitions factory
    this.definitionsFactory =
        (DefinitionsFactory) getServletContext().getAttribute(TilesUtilImpl.DEFINITIONS_FACTORY);
    if (this.definitionsFactory == null) {
      throw new ApplicationContextException("Tiles definitions factory not found: TilesConfigurer not defined?");
    }
  }
View Full Code Here

      this.messageSourceAccessor = null;
    }
    else if (this.applicationContext == null) {
      // Initialize with passed-in context.
      if (!requiredContextClass().isInstance(context)) {
        throw new ApplicationContextException(
            "Invalid application context: needs to be of type [" + requiredContextClass().getName() + "]");
      }
      this.applicationContext = context;
      this.messageSourceAccessor = new MessageSourceAccessor(context);
      initApplicationContext();
    }
    else {
      // Ignore reinitialization if same context passed in.
      if (this.applicationContext != context) {
        throw new ApplicationContextException(
            "Cannot reinitialize with different application context: current one is [" +
            this.applicationContext + "], passed-in one is [" + context + "]");
      }
    }
  }
View Full Code Here

      synchronized (this.beanFactoryMonitor) {
        this.beanFactory = beanFactory;
      }
    }
    catch (IOException ex) {
      throw new ApplicationContextException(
          "I/O error parsing XML document for application context [" + 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(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

  protected WebApplicationContext createWebApplicationContext(
      ServletContext servletContext, ApplicationContext parent) throws BeansException {

    Class contextClass = determineContextClass(servletContext);
    if (!ConfigurableWebApplicationContext.class.isAssignableFrom(contextClass)) {
      throw new ApplicationContextException("Custom context class [" + contextClass.getName() +
          "] is not of type [" + ConfigurableWebApplicationContext.class.getName() + "]");
    }

    ConfigurableWebApplicationContext wac =
        (ConfigurableWebApplicationContext) BeanUtils.instantiateClass(contextClass);
View Full Code Here

    if (contextClassName != null) {
      try {
        return ClassUtils.forName(contextClassName);
      }
      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);
      }
      catch (ClassNotFoundException ex) {
        throw new ApplicationContextException(
            "Failed to load default context class [" + contextClassName + "]", 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

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.