org.springframework.beans.BeansException

Here are the examples of the java api org.springframework.beans.BeansException taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

6 Examples 7

19 Source : AbstractApplicationContext.java
with Apache License 2.0
from langtianya

/**
 * Cancel this context's refresh attempt, resetting the {@code active} flag
 * after an exception got thrown.
 * @param ex the exception that led to the cancellation
 */
protected void cancelRefresh(BeansException ex) {
    this.active.set(false);
}

18 Source : TestContextTransactionUtils.java
with MIT License
from Vip-Augus

private static void logBeansException(TestContext testContext, BeansException ex, Clreplaced<?> beanType) {
    if (logger.isDebugEnabled()) {
        logger.debug(String.format("Caught exception while retrieving %s for test context %s", beanType.getSimpleName(), testContext), ex);
    }
}

18 Source : GenericApplicationContext.java
with MIT License
from Vip-Augus

@Override
protected void cancelRefresh(BeansException ex) {
    this.beanFactory.setSerializationId(null);
    super.cancelRefresh(ex);
}

18 Source : AbstractRefreshableApplicationContext.java
with MIT License
from Vip-Augus

@Override
protected void cancelRefresh(BeansException ex) {
    synchronized (this.beanFactoryMonitor) {
        if (this.beanFactory != null) {
            this.beanFactory.setSerializationId(null);
        }
    }
    super.cancelRefresh(ex);
}

18 Source : ServiceLocatorFactoryBean.java
with MIT License
from Vip-Augus

/**
 * Create a service locator exception for the given cause.
 * Only called in case of a custom service locator exception.
 * <p>The default implementation can handle all variations of
 * message and exception arguments.
 * @param exceptionConstructor the constructor to use
 * @param cause the cause of the service lookup failure
 * @return the service locator exception to throw
 * @see #setServiceLocatorExceptionClreplaced
 */
protected Exception createServiceLocatorException(Constructor<Exception> exceptionConstructor, BeansException cause) {
    Clreplaced<?>[] paramTypes = exceptionConstructor.getParameterTypes();
    Object[] args = new Object[paramTypes.length];
    for (int i = 0; i < paramTypes.length; i++) {
        if (String.clreplaced == paramTypes[i]) {
            args[i] = cause.getMessage();
        } else if (paramTypes[i].isInstance(cause)) {
            args[i] = cause;
        }
    }
    return BeanUtils.instantiateClreplaced(exceptionConstructor, args);
}

18 Source : AbstractRefreshableApplicationContext.java
with Apache License 2.0
from langtianya

@Override
protected void cancelRefresh(BeansException ex) {
    synchronized (this.beanFactoryMonitor) {
        if (this.beanFactory != null)
            this.beanFactory.setSerializationId(null);
    }
    super.cancelRefresh(ex);
}