Package org.springframework.beans.factory

Examples of org.springframework.beans.factory.BeanInitializationException


      // Let the subclass process the properties.
      processProperties(beanFactory, mergedProps);
    }
    catch (IOException ex) {
      throw new BeanInitializationException("Could not load properties", ex);
    }
  }
View Full Code Here


          if (isRequiredProperty(pd) && !pvs.contains(pd.getName())) {
            invalidProperties.add(pd.getName());
          }
        }
        if (!invalidProperties.isEmpty()) {
          throw new BeanInitializationException(buildExceptionMessage(invalidProperties, beanName));
        }
      }
      this.validatedBeanNames.add(beanName);
    }
    return pvs;
View Full Code Here

    // Let concrete implementations initialize themselves.
    try {
      initDao();
    }
    catch (Exception ex) {
      throw new BeanInitializationException("Initialization of DAO failed", ex);
    }
  }
View Full Code Here

    }
    try {
      initGateway();
    }
    catch (Exception ex) {
      throw new BeanInitializationException("Initialization of JMS gateway failed: " + ex.getMessage(), ex);
    }
  }
View Full Code Here

   * @see #getDefaultStrategies
   */
  protected Object getDefaultStrategy(ApplicationContext context, Class strategyInterface) throws BeansException {
    List strategies = getDefaultStrategies(context, strategyInterface);
    if (strategies.size() != 1) {
      throw new BeanInitializationException(
          "DispatcherServlet needs exactly 1 strategy for interface [" + strategyInterface.getName() + "]");
    }
    return strategies.get(0);
  }
View Full Code Here

          Class clazz = ClassUtils.forName(className, getClass().getClassLoader());
          Object strategy = createDefaultStrategy(context, clazz);
          strategies.add(strategy);
        }
        catch (ClassNotFoundException ex) {
          throw new BeanInitializationException(
              "Could not find DispatcherServlet's default strategy class [" + className +
              "] for interface [" + key + "]", ex);
        }
        catch (LinkageError err) {
          throw new BeanInitializationException(
              "Error loading DispatcherServlet's default strategy class [" + className +
              "] for interface [" + key + "]: problem with class file or dependent class", err);
        }
      }
    }
View Full Code Here

      }
      try {
        ((Servlet) bean).init(config);
      }
      catch (ServletException ex) {
        throw new BeanInitializationException("Servlet.init threw exception", ex);
      }
    }
    return bean;
  }
View Full Code Here

        processKey(beanFactory, key, props.getProperty(key));
      }
      catch (BeansException ex) {
        String msg = "Could not process key '" + key + "' in PropertyOverrideConfigurer";
        if (!this.ignoreInvalidKeys) {
          throw new BeanInitializationException(msg, ex);
        }
        if (logger.isDebugEnabled()) {
          logger.debug(msg, ex);
        }
      }
View Full Code Here

  protected void processKey(ConfigurableListableBeanFactory factory, String key, String value)
      throws BeansException {

    int separatorIndex = key.indexOf(this.beanNameSeparator);
    if (separatorIndex == -1) {
      throw new BeanInitializationException("Invalid key '" + key +
          "': expected 'beanName" + this.beanNameSeparator + "property'");
    }
    String beanName = key.substring(0, separatorIndex);
    String beanProperty = key.substring(separatorIndex+1);
    this.beanNames.add(beanName);
View Full Code Here

      }
      try {
        ((Portlet) bean).init(config);
      }
      catch (PortletException ex) {
        throw new BeanInitializationException("Portlet.init threw exception", ex);
      }
    }
    return bean;
  }
View Full Code Here

TOP

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

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.