Package org.springframework.beans

Examples of org.springframework.beans.FatalBeanException


  private static final String ERRORS_KEY = "com.skyline.common.validation.Errors";
 
  @Override
  public void afterPropertiesSet() throws Exception {
    if (this.validatorResources == null) {
      throw new FatalBeanException(
          "Unable to locate validation configuration. Property [validationLocations] is required.");
    }
  }
View Full Code Here


      for (int i = 0; i < inputStreams.length; i++) {
        inputStreams[i] = validationConfigLocations[i].getInputStream();
      }
      this.validatorResources = new ValidatorResources(inputStreams);
    } catch (IOException e) {
      throw new FatalBeanException("Unable to read validation configuration due to IOException.", e);
    } catch (SAXException e) {
      throw new FatalBeanException("Unable to parse validation configuration XML", e);
    }
  }
View Full Code Here

            } else {
                try {
                    Object obj = ClassLoaderUtils.loadClass(val, getClass()).newInstance();
                    bean.addConstructorArg(obj);
                } catch (Exception e) {
                    throw new FatalBeanException("Could not load class: " + val, e);
                }
            }
        }
    }
View Full Code Here

       
        if (referenceObj != null) {
            try {                                                      
                pd.getWriteMethod().invoke(bean, new Object[] { referenceObj });
            } catch (Throwable e) {
                throw new FatalBeanException("Problem injecting reference:  " + e.getMessage(), e);
            }
        }
    }
View Full Code Here

       
        if (propertyObj != null) {
            try {                                                      
                pd.getWriteMethod().invoke(bean, new Object[] { propertyObj });
            } catch (Throwable e) {
                throw new FatalBeanException("Problem injecting property:  " + e.getMessage(), e);
            }
        }
    }
View Full Code Here

                        Object nameObj = component.getName();                   
                        if (nameObj != null) {
                            try {                                                      
                                pd.getWriteMethod().invoke(bean, new Object[] { nameObj });
                            } catch (Throwable e) {
                                throw new FatalBeanException("Problem injecting reference:  " + e.getMessage(), e);
                            }
                        }
                    } else {
                        throw new IllegalStateException("ComponentName annotation is supported only on java.lang.String field type.");
                    }
View Full Code Here

            } else {
                try {
                    Object obj = ClassLoaderUtils.loadClass(val, getClass()).newInstance();
                    bean.addConstructorArg(obj);
                } catch (Exception e) {
                    throw new FatalBeanException("Could not load class: " + val, e);
                }
            }
        }
    }
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

    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

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.