Package org.springframework.beans.factory

Examples of org.springframework.beans.factory.BeanInitializationException


      }
      try {
        ((Portlet) bean).init(config);
      }
      catch (PortletException ex) {
        throw new BeanInitializationException("Portlet.init threw exception", ex);
      }
    }
    return bean;
  }
View Full Code Here


        log.debug("Creating Shiro Filter instance.");

        SecurityManager securityManager = getSecurityManager();
        if (securityManager == null) {
            String msg = "SecurityManager property must be set.";
            throw new BeanInitializationException(msg);
        }

        if (!(securityManager instanceof WebSecurityManager)) {
            String msg = "The security manager does not implement the WebSecurityManager interface.";
            throw new BeanInitializationException(msg);
        }

        FilterChainManager manager = createFilterChainManager();

        //路径匹配
View Full Code Here

   * @see #getDefaultStrategies
   */
  protected Object getDefaultStrategy(ApplicationContext context, Class strategyInterface) throws BeansException {
    List strategies = getDefaultStrategies(context, strategyInterface);
    if (strategies.size() != 1) {
      throw new BeanInitializationException(
          "DispatcherServlet needs exactly 1 strategy for interface [" + strategyInterface.getName() + "]");
    }
    return strategies.get(0);
  }
View Full Code Here

          Class clazz = ClassUtils.forName(className, DispatcherServlet.class.getClassLoader());
          Object strategy = createDefaultStrategy(context, clazz);
          strategies.add(strategy);
        }
        catch (ClassNotFoundException ex) {
          throw new BeanInitializationException(
              "Could not find DispatcherServlet's default strategy class [" + className +
              "] for interface [" + key + "]", ex);
        }
        catch (LinkageError err) {
          throw new BeanInitializationException(
              "Error loading DispatcherServlet's default strategy class [" + className +
              "] for interface [" + key + "]: problem with class file or dependent class", err);
        }
      }
    }
View Full Code Here

        else {
          this.propertySources.addLast(localPropertySource);
        }
      }
      catch (IOException ex) {
        throw new BeanInitializationException("Could not load properties", ex);
      }
    }

    this.processProperties(beanFactory, new PropertySourcesPropertyResolver(this.propertySources));
  }
View Full Code Here

          if (isRequiredProperty(pd) && !pvs.contains(pd.getName())) {
            invalidProperties.add(pd.getName());
          }
        }
        if (!invalidProperties.isEmpty()) {
          throw new BeanInitializationException(buildExceptionMessage(invalidProperties, beanName));
        }
      }
      this.validatedBeanNames.add(beanName);
    }
    return pvs;
View Full Code Here

   * @see #getDefaultStrategies
   */
  protected <T> T getDefaultStrategy(ApplicationContext context, Class<T> strategyInterface) {
    List<T> strategies = getDefaultStrategies(context, strategyInterface);
    if (strategies.size() != 1) {
      throw new BeanInitializationException(
          "DispatcherServlet needs exactly 1 strategy for interface [" + strategyInterface.getName() + "]");
    }
    return strategies.get(0);
  }
View Full Code Here

          Class<?> clazz = ClassUtils.forName(className, DispatcherServlet.class.getClassLoader());
          Object strategy = createDefaultStrategy(context, clazz);
          strategies.add((T) strategy);
        }
        catch (ClassNotFoundException ex) {
          throw new BeanInitializationException(
              "Could not find DispatcherServlet's default strategy class [" + className +
                  "] for interface [" + key + "]", ex);
        }
        catch (LinkageError err) {
          throw new BeanInitializationException(
              "Error loading DispatcherServlet's default strategy class [" + className +
                  "] for interface [" + key + "]: problem with class file or dependent class", err);
        }
      }
      return strategies;
View Full Code Here

        Class<?> clazz;
        try {
          String className = "org.springframework.validation.beanvalidation.LocalValidatorFactoryBean";
          clazz = ClassUtils.forName(className, WebMvcConfigurationSupport.class.getClassLoader());
        } catch (ClassNotFoundException e) {
          throw new BeanInitializationException("Could not find default validator");
        } catch (LinkageError e) {
          throw new BeanInitializationException("Could not find default validator");
        }
        validator = (Validator) BeanUtils.instantiate(clazz);
      }
      else {
        validator = new Validator() {
View Full Code Here

      configureContentNegotiation(configurer);
      try {
        this.contentNegotiationManager = configurer.getContentNegotiationManager();
      }
      catch (Exception e) {
        throw new BeanInitializationException("Could not create ContentNegotiationManager", e);
      }
    }
    return this.contentNegotiationManager;
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.BeanInitializationException

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.