Package org.springframework.beans

Examples of org.springframework.beans.BeansException


    public <T> T getBean(Class<T> tClass) throws BeansException {
        Map<String, T> foundBeans = getBeansOfType(tClass);
        final int numberOfBeans = foundBeans.size();
        if (numberOfBeans == 0 || numberOfBeans > 1) {
            //TODO: Find some better concrete exception
            throw new BeansException(
                    format("Just one %s bean expected. Found %d.", tClass.getName(), numberOfBeans)) {};
        }
        return foundBeans.entrySet().iterator().next().getValue();
    }
View Full Code Here


      try {
        Map context = new HashMap();
        context.put("returned", target);
        Ognl.getValue(ognlExpression, context, target);
      } catch (OgnlException e) {
        throw new BeansException("Error occured while evaluating OGNL expression [" + ognlExpression + "]!", e) {};
      }
    }
  }
View Full Code Here

     
      if (value != null) {
        if (value instanceof Validator) {
          validator = (Validator)value;
        } else {
          throw new BeansException("Instance for class [" + clazz + "] is not of type org.springframework.validation.Validator!") {};
        }
      } else {
        throw new BeansException("Validator for class [" + clazz + "] is not specified!") {};
      }
     
      if (key instanceof Class) {
        clazz = (Class)key;
        addValidator(ALL, clazz, validator);
View Full Code Here

 
  protected Class loadClass(String className) {
    try {
      return ClassUtils.forName(className);
    } catch (ClassNotFoundException e) {
      throw new BeansException("Could not find class [" + className + "]", e) {};
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.BeansException

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.