Package org.springframework.beans.factory

Examples of org.springframework.beans.factory.BeanDefinitionStoreException


    }
    else if (attributeValue instanceof String) {
      refreshCheckDelay = Long.parseLong((String) attributeValue);
    }
    else if (attributeValue != null) {
      throw new BeanDefinitionStoreException(
          "Invalid refresh check delay attribute [" + REFRESH_CHECK_DELAY_ATTRIBUTE +
          "] with value [" + attributeValue + "]: needs to be of type Number or String");
    }
    return refreshCheckDelay;
  }
View Full Code Here


                logger.trace("Ignored because not matching any filter: " + resource);
              }
            }
          }
          catch (Throwable ex) {
            throw new BeanDefinitionStoreException(
                "Failed to read candidate component class: " + resource, ex);
          }
        }
        else {
          if (traceEnabled) {
            logger.trace("Ignored because not readable: " + resource);
          }
        }
      }
    }
    catch (IOException ex) {
      throw new BeanDefinitionStoreException("I/O failure during classpath scanning", ex);
    }
    return candidates;
  }
View Full Code Here

        BeanDefinition bd = beanFactoryToProcess.getBeanDefinition(curName);
        try {
          visitor.visitBeanDefinition(bd);
        }
        catch (Exception ex) {
          throw new BeanDefinitionStoreException(bd.getResourceDescription(), curName, ex.getMessage());
        }
      }
    }

    // New in Spring 2.5: resolve placeholders in alias target names and aliases as well.
View Full Code Here

        else {
          parser.parse(bd.getBeanClassName(), holder.getBeanName());
        }
      }
      catch (IOException ex) {
        throw new BeanDefinitionStoreException("Failed to load bean class: " + bd.getBeanClassName(), ex);
      }
    }
    parser.validate();

    // Handle any @PropertySource annotations
View Full Code Here

    Map<String, AbstractBeanDefinition> configBeanDefs = new LinkedHashMap<String, AbstractBeanDefinition>();
    for (String beanName : beanFactory.getBeanDefinitionNames()) {
      BeanDefinition beanDef = beanFactory.getBeanDefinition(beanName);
      if (ConfigurationClassUtils.isFullConfigurationClass(beanDef)) {
        if (!(beanDef instanceof AbstractBeanDefinition)) {
          throw new BeanDefinitionStoreException("Cannot enhance @Configuration bean definition '" +
              beanName + "' since it is not stored in an AbstractBeanDefinition subclass");
        }
        configBeanDefs.put(beanName, (AbstractBeanDefinition) beanDef);
      }
    }
View Full Code Here

    if (beanDefinition instanceof AbstractBeanDefinition) {
      try {
        ((AbstractBeanDefinition) beanDefinition).validate();
      }
      catch (BeanDefinitionValidationException ex) {
        throw new BeanDefinitionStoreException(beanDefinition.getResourceDescription(), beanName,
            "Validation of bean definition failed", ex);
      }
    }

    synchronized (this.beanDefinitionMap) {
      Object oldBeanDefinition = this.beanDefinitionMap.get(beanName);
      if (oldBeanDefinition != null) {
        if (!this.allowBeanDefinitionOverriding) {
          throw new BeanDefinitionStoreException(beanDefinition.getResourceDescription(), beanName,
              "Cannot register bean definition [" + beanDefinition + "] for bean '" + beanName +
              "': There is already [" + oldBeanDefinition + "] bound.");
        }
        else {
          if (this.logger.isInfoEnabled()) {
View Full Code Here

    // Prepare method overrides.
    try {
      mbd.prepareMethodOverrides();
    }
    catch (BeanDefinitionValidationException ex) {
      throw new BeanDefinitionStoreException(mbd.getResourceDescription(),
          beanName, "Validation of method overrides failed", ex);
    }

    try {
      // Give BeanPostProcessors a chance to return a proxy instead of the target bean instance.
View Full Code Here

    boolean isStatic = true;

    String factoryBeanName = mbd.getFactoryBeanName();
    if (factoryBeanName != null) {
      if (factoryBeanName.equals(beanName)) {
        throw new BeanDefinitionStoreException(mbd.getResourceDescription(), beanName,
            "factory-bean reference points back to the same bean definition");
      }
      // Check declared factory method return type on factory class.
      factoryClass = getType(factoryBeanName);
      isStatic = false;
View Full Code Here

          currentlyInvokedFactoryMethod.remove();
        }
      }
    }
    catch (IllegalArgumentException ex) {
      throw new BeanDefinitionStoreException(
          "Illegal arguments to factory method [" + factoryMethod + "]; " +
          "args: " + StringUtils.arrayToCommaDelimitedString(args));
    }
    catch (IllegalAccessException ex) {
      throw new BeanDefinitionStoreException(
          "Cannot access factory method [" + factoryMethod + "]; is it public?");
    }
    catch (InvocationTargetException ex) {
      throw new BeanDefinitionStoreException(
          "Factory method [" + factoryMethod + "] threw exception", ex.getTargetException());
    }
  }
View Full Code Here

                    "': cannot be resolved without an AbstractBeanFactory parent");
              }
            }
          }
          catch (NoSuchBeanDefinitionException ex) {
            throw new BeanDefinitionStoreException(bd.getResourceDescription(), beanName,
                "Could not resolve parent bean definition '" + bd.getParentName() + "'", ex);
          }
          // Deep copy with overridden values.
          mbd = new RootBeanDefinition(pbd);
          mbd.overrideFrom(bd);
View Full Code Here

TOP

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

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.