Package org.springframework.beans.factory

Examples of org.springframework.beans.factory.BeanDefinitionStoreException


    }

    // Check validity of the usage of the args parameter. This can
    // only be used for prototypes constructed via a factory method.
    if (args != null && !mbd.isPrototype()) {
      throw new BeanDefinitionStoreException(
          "Can only specify arguments for the getBean method when referring to a prototype bean definition");
    }
  }
View Full Code Here


  public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
    super.setBeanFactory(beanFactory);

    // Check whether the target bean is defined as prototype.
    if (!beanFactory.isPrototype(getTargetBeanName())) {
      throw new BeanDefinitionStoreException(
          "Cannot use prototype-based TargetSource against non-prototype bean with name '" +
          getTargetBeanName() + "': instances would not be independent");
    }
  }
View Full Code Here

  public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
    super.setBeanFactory(beanFactory);

    // Check whether the target bean is defined as prototype.
    if (!beanFactory.isPrototype(getTargetBeanName())) {
      throw new BeanDefinitionStoreException(
          "Cannot use prototype-based TargetSource against non-prototype bean with name '" +
          getTargetBeanName() + "': instances would not be independent");
    }
  }
View Full Code Here

    if (attributeValue instanceof Number) {
      refreshCheckDelay = ((Number) attributeValue).longValue();
    } 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

    if (attributeValue instanceof Boolean) {
      proxyTargetClass = ((Boolean) attributeValue).booleanValue();
    } else if (attributeValue instanceof String) {
      proxyTargetClass = new Boolean((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 proxyTargetClass;
  }
View Full Code Here

    }
    catch (TypeMismatchNamingException ex) {
      throw new BeanNotOfRequiredTypeException(name, ex.getRequiredType(), ex.getActualType());
    }
    catch (NamingException ex) {
      throw new BeanDefinitionStoreException("JNDI environment", name, "JNDI lookup failed", ex);
    }
  }
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

        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 (attributeValue instanceof Number) {
      refreshCheckDelay = ((Number) attributeValue).longValue();
    } 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

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.