Package org.springframework.beans.factory

Examples of org.springframework.beans.factory.BeanInitializationException


        if (StringUtils.hasText(title)) {
          configurable.setTitle(title);
        }
      }
      catch (NoSuchMessageException e) {
        throw new BeanInitializationException("Unable to initialize bean " + name, e);
      }
    }

    return bean;
  }
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(
          "DispatcherPortlet needs exactly 1 strategy for interface [" + strategyInterface.getName() + "]");
    }
    return strategies.get(0);
  }
View Full Code Here

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

  public void afterPropertiesSet() throws Exception {
    try {
      initAction();
    } catch (Exception ex) {
      throw new BeanInitializationException("Initialization of this Action failed: " + ex.getMessage(), ex);
    }
  }
View Full Code Here

        for ( Notifier notifier : beans.values() )
        {

            if ( notifiers.containsKey( notifier.getType() ) )
            {
                throw new BeanInitializationException(
                    "There are two Notifier beans in the appllication context for Notifier type " + notifier.getType() +
                        ". Probably two conflicting scm implementations are present in the classpath." );
            }

            if ( log.isDebugEnabled() )
View Full Code Here

        Constructor ctor = BurlapSkeleton.class.getConstructor(new Class[] {Object.class});
        this.skeleton = (BurlapSkeleton) ctor.newInstance(new Object[] {getProxyForService()});
      }
    }
    catch (Exception ex) {
      throw new BeanInitializationException("Burlap skeleton initialization failed", ex);
    }
  }
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

            Method method = pd.getReadMethod();
            Collection<String> c = CastUtils.cast((Collection<?>)method.invoke(bean, new Object[0]));

            return c;
        } catch (IllegalArgumentException e) {
            throw new BeanInitializationException("Could not retrieve ids.", e);
        } catch (IllegalAccessException e) {
            throw new BeanInitializationException("Could not access id getter.", e);
        } catch (InvocationTargetException e) {
            throw new BeanInitializationException("Could not invoke id getter.", e);
        } catch (SecurityException e) {
            throw new BeanInitializationException("Could not invoke id getter.", e);
        }
    }
View Full Code Here

            Collection<QName> c = CastUtils.cast((Collection<?>)method.invoke(bean, new Object[0]),
                QName.class);

            return c;
        } catch (IllegalArgumentException e) {
            throw new BeanInitializationException("Could not retrieve ids.", e);
        } catch (IllegalAccessException e) {
            throw new BeanInitializationException("Could not access id getter.", e);
        } catch (InvocationTargetException e) {
            throw new BeanInitializationException("Could not invoke id getter.", e);
        } catch (SecurityException e) {
            throw new BeanInitializationException("Could not invoke id getter.", e);
        }
    }
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.