Package org.springframework.context

Examples of org.springframework.context.ApplicationContextException


      this.logger.debug("Servlet with name '" + getServletName() +
          "' 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 servlet with name '" + getServletName() +
          "': custom WebApplicationContext class [" + getContextClass().getName() +
          "] is not of type ConfigurableWebApplicationContext");
    }
View Full Code Here


         * HttpServlet API.
         */
        if (this.initSuccess) {
            this.delegate.service(req, resp);
        } else {
            throw new ApplicationContextException(
                "Unable to initialize application context.");
        }
    }
View Full Code Here

   * @see ConfigurableWebApplicationContext
   */
  protected WebApplicationContext createWebApplicationContext(ServletContext sc) {
    Class<?> contextClass = determineContextClass(sc);
    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);
    return wac;
View Full Code Here

    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

          Assert.isAssignable(ApplicationContextInitializer.class, clazz,
              "class [" + className + "] must implement ApplicationContextInitializer");
          classes.add((Class<ApplicationContextInitializer<ConfigurableApplicationContext>>)clazz);
        }
        catch (ClassNotFoundException ex) {
          throw new ApplicationContextException(
              "Failed to load context initializer class [" + className + "]", ex);
        }
      }
    }
    return classes;
View Full Code Here

      }

      log.warn("Timeout occured before finding service dependencies for [" + delegateContext.getDisplayName()
          + "]");

      ApplicationContextException e = new ApplicationContextException("Application context initializition for '"
          + OsgiStringUtils.nullSafeSymbolicName(getBundle()) + "' has timed out");
      e.fillInStackTrace();
      fail(e);

    }
  }
View Full Code Here

    try {
      Class managerClass = loader.loadClass(EXPORTER_IMPORTER_DEPENDENCY_MANAGER);
      instance = BeanUtils.instantiateClass(managerClass);
    }
    catch (ClassNotFoundException cnfe) {
      throw new ApplicationContextException("Cannot load class " + EXPORTER_IMPORTER_DEPENDENCY_MANAGER, cnfe);
    }

    // sanity check
    Assert.isInstanceOf(BeanFactoryAware.class, instance);
    Assert.isInstanceOf(BeanPostProcessor.class, instance);
View Full Code Here

        if (ObjectUtils.isEmpty(getConfigLocations())) {
          setConfigLocations(getDefaultConfigLocations());
        }
        if (!OsgiBundleUtils.isBundleActive(getBundle())) {
          throw new ApplicationContextException("Unable to refresh application context: bundle is "
              + OsgiStringUtils.bundleStateAsString(getBundle()));
        }

        ConfigurableListableBeanFactory beanFactory = null;
        // Prepare this context for refreshing.
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.