Package org.springframework.beans

Examples of org.springframework.beans.FatalBeanException


    }
    else if (Collection.class.isAssignableFrom(type) && type.isInterface()) {
      Class elementType = descriptor.getCollectionType();
      if (elementType == null) {
        if (descriptor.isRequired()) {
          throw new FatalBeanException("No element type declared for collection [" + type.getName() + "]");
        }
        return null;
      }
      Map<String, Object> matchingBeans = findAutowireCandidates(beanName, elementType, descriptor);
      if (matchingBeans.isEmpty()) {
        if (descriptor.isRequired()) {
          raiseNoSuchBeanDefinitionException(elementType, "collection of " + elementType.getName(), descriptor);
        }
        return null;
      }
      if (autowiredBeanNames != null) {
        autowiredBeanNames.addAll(matchingBeans.keySet());
      }
      TypeConverter converter = (typeConverter != null ? typeConverter : getTypeConverter());
      return converter.convertIfNecessary(matchingBeans.values(), type);
    }
    else if (Map.class.isAssignableFrom(type) && type.isInterface()) {
      Class keyType = descriptor.getMapKeyType();
      if (keyType == null || !String.class.isAssignableFrom(keyType)) {
        if (descriptor.isRequired()) {
          throw new FatalBeanException("Key type [" + keyType + "] of map [" + type.getName() +
              "] must be assignable to [java.lang.String]");
        }
        return null;
      }
      Class valueType = descriptor.getMapValueType();
      if (valueType == null) {
        if (descriptor.isRequired()) {
          throw new FatalBeanException("No value type declared for map [" + type.getName() + "]");
        }
        return null;
      }
      Map<String, Object> matchingBeans = findAutowireCandidates(beanName, valueType, descriptor);
      if (matchingBeans.isEmpty()) {
View Full Code Here


      else {
        throw new IllegalArgumentException("Unsupported filter type: " + filterType);
      }
    }
    catch (ClassNotFoundException ex) {
      throw new FatalBeanException("Type filter class not found: " + expression, ex);
    }
  }
View Full Code Here

                        plus++;
                        minus++;
                    }
                }
                catch (Throwable ex) {
                    FatalBeanException errorVar = new FatalBeanException("DisplayNode: Could not compare properties from source", ex);
                    ErrorMgr.addError(errorVar);
                    throw errorVar;
                }
            }
        }
View Full Code Here

    else {
      String className = (String) handlerOrClassName;
      try {
        Class handlerClass = ClassUtils.forName(className, this.classLoader);
        if (!NamespaceHandler.class.isAssignableFrom(handlerClass)) {
          throw new FatalBeanException("Class [" + className + "] for namespace [" + namespaceUri +
              "] does not implement the [" + NamespaceHandler.class.getName() + "] interface");
        }
        NamespaceHandler namespaceHandler = (NamespaceHandler) BeanUtils.instantiateClass(handlerClass);
        namespaceHandler.init();
        handlerMappings.put(namespaceUri, namespaceHandler);
        return namespaceHandler;
      }
      catch (ClassNotFoundException ex) {
        throw new FatalBeanException("NamespaceHandler class [" + className + "] for namespace [" +
            namespaceUri + "] not found", ex);
      }
      catch (LinkageError err) {
        throw new FatalBeanException("Invalid NamespaceHandler class [" + className + "] for namespace [" +
            namespaceUri + "]: problem with handler class file or dependent class", err);
      }
    }
  }
View Full Code Here

      else {
        throw new IllegalArgumentException("Unsupported filter type: " + filterType);
      }
    }
    catch (ClassNotFoundException ex) {
      throw new FatalBeanException("Type filter class not found: " + expression, ex);
    }
  }
View Full Code Here

                        plus++;
                        minus++;
                    }
                }
                catch (Throwable ex) {
                    FatalBeanException errorVar = new FatalBeanException("DisplayNode: Could not compare properties from source", ex);
                    ErrorMgr.addError(errorVar);
                    throw errorVar;
                }
            }
        }
View Full Code Here

    this.serviceMappings = serviceMappings;
  }

  public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
    if (!(beanFactory instanceof ListableBeanFactory)) {
      throw new FatalBeanException(
          "ServiceLocatorFactoryBean needs to run in a BeanFactory that is a ListableBeanFactory");
    }
    this.beanFactory = (ListableBeanFactory) beanFactory;
  }
View Full Code Here

          if (this.ignoreUnresolvableEditors) {
            logger.info("Skipping editor [" + value + "] for required type [" + key + "]: " +
                (requiredType != null ? "editor" : "required type") + " class not found.");
          }
          else {
            throw new FatalBeanException(
                (requiredType != null ? "Editor" : "Required type") + " class not found", ex);
          }
        }
      }
    }
View Full Code Here

      else {
        throw new IllegalArgumentException("Unsupported filter type: " + filterType);
      }
    }
    catch (ClassNotFoundException ex) {
      throw new FatalBeanException("Type filter class not found: " + expression, ex);
    }
  }
View Full Code Here

    this.serviceMappings = serviceMappings;
  }

  public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
    if (!(beanFactory instanceof ListableBeanFactory)) {
      throw new FatalBeanException(
          "ServiceLocatorFactoryBean needs to run in a BeanFactory that is a ListableBeanFactory");
    }
    this.beanFactory = (ListableBeanFactory) beanFactory;
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.FatalBeanException

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.