Package org.springframework.context

Examples of org.springframework.context.ApplicationContextException


  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, ContextLoader.class.getClassLoader());
      }
      catch (ClassNotFoundException ex) {
        throw new ApplicationContextException(
            "Failed to load default context class [" + contextClassName + "]", ex);
      }
    }
  }
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

  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

      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(context);
    }
    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.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

          logger.debug("Mapped view class [" + className + "] to mapping key [" + discriminator + "]");
        }
        this.formatMappings.put(discriminator, ClassUtils.forName(className));
      }
      catch (ClassNotFoundException ex) {
        throw new ApplicationContextException(
            "Class [" + className + "] mapped to format [" + discriminator + "] cannot be found", 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.