Package org.springframework.beans.factory

Examples of org.springframework.beans.factory.BeanCreationException


                    {
                        returnData = IOUtils.getResourceAsString(file, getClass());
                    }
                    catch (IOException e)
                    {
                        throw new BeanCreationException("Failed to load test-data resource: " + file, e);
                    }
                }
                else
                {
                    returnData = rData.getTextContent();
                }
            }
            else if ("callback".equals(list.item(i).getLocalName()))
            {
                Element ele = (Element) list.item(i);
                String c = ele.getAttribute("class");
                try
                {
                    EventCallback cb = (EventCallback)ClassUtils.instanciateClass(c);
                    props.put("eventCallback", cb);

                }
                catch (Exception e)
                {
                    throw new BeanCreationException("Failed to load event-callback: " + c, e);
                }
            }

        }
View Full Code Here


    }
    catch(Error e){
      throw e;
    }
    catch(Exception e){
      throw new BeanCreationException(beanname, "FactoryBean failed", e);
    }
  }
View Full Code Here

    InjectionMetadata metadata = findPersistenceMetadata(bean.getClass());
    try {
      metadata.injectFields(bean, beanName);
    }
    catch (Throwable ex) {
      throw new BeanCreationException(beanName, "Injection of persistence fields failed", ex);
    }
    return true;
  }
View Full Code Here

    InjectionMetadata metadata = findPersistenceMetadata(bean.getClass());
    try {
      metadata.injectMethods(bean, beanName, pvs);
    }
    catch (Throwable ex) {
      throw new BeanCreationException(beanName, "Injection of persistence methods failed", ex);
    }
    return pvs;
  }
View Full Code Here

    InjectionMetadata metadata = findResourceMetadata(bean.getClass());
    try {
      metadata.injectFields(bean, beanName);
    }
    catch (Throwable ex) {
      throw new BeanCreationException(beanName, "Injection of resource fields failed", ex);
    }
    return true;
  }
View Full Code Here

    InjectionMetadata metadata = findResourceMetadata(bean.getClass());
    try {
      metadata.injectMethods(bean, beanName, pvs);
    }
    catch (Throwable ex) {
      throw new BeanCreationException(beanName, "Injection of resource methods failed", ex);
    }
    return pvs;
  }
View Full Code Here

      }
    }
    catch (BeanCreationException ex) {
      Throwable rootCause = ex.getMostSpecificCause();
      if (rootCause instanceof BeanCurrentlyInCreationException) {
        BeanCreationException bce = (BeanCreationException) rootCause;
        if (this.beanFactory.isCurrentlyInCreation(bce.getBeanName())) {
          String msg = ClassUtils.getShortName(getClass()) + " failed to create target bean '" +
              bce.getBeanName() + "' while configuring object of type [" +
              beanInstance.getClass().getName() + "] (probably due to a circular reference). " +
              "Proceeding without injection.";
          if (logger.isDebugEnabled()) {
            logger.debug(msg, ex);
          }
View Full Code Here

    if (bean instanceof FactoryBean && !BeanFactoryUtils.isFactoryDereference(name)) {
      try {
        return ((FactoryBean) bean).getObject();
      }
      catch (Exception ex) {
        throw new BeanCreationException(beanName, "FactoryBean threw exception on object creation", ex);
      }
    }
    return bean;
  }
View Full Code Here

          return typedStringValue.getValue();
        }
      }
      catch (Throwable ex) {
        // Improve the message by showing the context.
        throw new BeanCreationException(
            this.beanDefinition.getResourceDescription(), this.beanName,
            "Error converting typed String value for " + argName, ex);
      }
    }
    else {
View Full Code Here

      else {
        return innerBean;
      }
    }
    catch (BeansException ex) {
      throw new BeanCreationException(
          this.beanDefinition.getResourceDescription(), this.beanName,
          "Cannot create inner bean '" + innerBeanName + "' " +
          (mbd != null && mbd.getBeanClassName() != null ? "of type [" + mbd.getBeanClassName() + "] " : "") +
          "while setting " + argName, ex);
    }
View Full Code Here

TOP

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

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.