Package org.springframework.beans.factory

Examples of org.springframework.beans.factory.BeanInitializationException


        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


     */
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        try {
            ContainerUtil.start(bean);
        } catch (Exception e) {
            throw new BeanInitializationException("Unable to start bean " + beanName, e);
        }
        return bean;
    }
View Full Code Here

     */
    public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException {
        try {
            ContainerUtil.stop(bean);
        } catch (Exception e) {
            throw new BeanInitializationException("Unable to stop bean " + beanName, e);
        }
        ContainerUtil.dispose(bean);
    }
View Full Code Here

            }
            @SuppressWarnings("unchecked")
            X ar[] = (X[])o;
            return Arrays.asList(ar);
        } 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

            {
                pfss.setScriptStorage(scriptStorage);
            }
            else if(otherScriptStorage != scriptStorage)
            {
                throw new BeanInitializationException(
                        "Persistent state storage uses a different script storage");
            }
        }
    }
View Full Code Here

        Constructor ctor = HessianSkeleton.class.getConstructor(new Class[] {Object.class});
        skeleton = (HessianSkeleton) ctor.newInstance(new Object[] {getProxyForService()});
      }
    }
    catch (Throwable ex) {
      throw new BeanInitializationException("Hessian skeleton initialization failed", ex);
    }

    if (hessian2Available) {
      // Hessian 2 (version 3.0.20+).
      this.skeletonInvoker = new Hessian2SkeletonInvoker(skeleton, this.serializerFactory, this.debugLogger);
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

        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

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.