Package org.springframework.beans.factory

Examples of org.springframework.beans.factory.BeanInitializationException


        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", e);
        }
        catch (LinkageError e) {
          throw new BeanInitializationException("Could not find default validator", e);
        }
        validator = (Validator) BeanUtils.instantiate(clazz);
      }
      else {
        validator = new Validator() {
View Full Code Here


    super.setBeanFactory(beanFactory);
    try {
      createPool();
    }
    catch (Throwable ex) {
      throw new BeanInitializationException("Could not create instance pool for TargetSource", ex);
    }
  }
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

        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(
          "DispatcherPortlet needs exactly 1 strategy for interface [" + strategyInterface.getName() + "]");
    }
    return strategies.get(0);
  }
View Full Code Here

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

        processKey(beanFactory, key, props.getProperty(key));
      }
      catch (BeansException ex) {
        String msg = "Could not process key '" + key + "' in PropertyOverrideConfigurer";
        if (!this.ignoreInvalidKeys) {
          throw new BeanInitializationException(msg, ex);
        }
        if (logger.isDebugEnabled()) {
          logger.debug(msg, ex);
        }
      }
View Full Code Here

  protected void processKey(ConfigurableListableBeanFactory factory, String key, String value)
      throws BeansException {

    int separatorIndex = key.indexOf(this.beanNameSeparator);
    if (separatorIndex == -1) {
      throw new BeanInitializationException("Invalid key '" + key +
          "': expected 'beanName" + this.beanNameSeparator + "property'");
    }
    String beanName = key.substring(0, separatorIndex);
    String beanProperty = key.substring(separatorIndex+1);
    this.beanNames.add(beanName);
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.