JUnit Singleton bean creation not allowed while singletons of this factory are in destruction

JUnit Singleton bean creation not allowed while singletons of this factory are in destruction

BeanCreationNotAllowedException.<init>

Best Java code snippets using org.springframework.beans.factory.BeanCreationNotAllowedException.<init>(Showing top 11 results out of 315)

if (singletonObject == null) { if (this.singletonsCurrentlyInDestruction) { throw new BeanCreationNotAllowedException(beanName, "Singleton bean creation not allowed while singletons of this factory are in destruction " + "(Do not request a bean from a BeanFactory in a destroy method implementation!)");

if (singletonObject == null) { if (this.singletonsCurrentlyInDestruction) { throw new BeanCreationNotAllowedException(beanName, "Singleton bean creation not allowed while singletons of this factory are in destruction " + "(Do not request a bean from a BeanFactory in a destroy method implementation!)");

@Override public void afterSingletonsInstantiated() { for (String beanName : this.beanFactory.getBeanNamesForType(IntegrationFlow.class)) { if (this.beanFactory.containsBeanDefinition(beanName)) { String scope = this.beanFactory.getBeanDefinition(beanName).getScope(); if (StringUtils.hasText(scope) && !BeanDefinition.SCOPE_SINGLETON.equals(scope)) { throw new BeanCreationNotAllowedException(beanName, "IntegrationFlows can not be scoped beans. " + "Any dependant beans are registered as singletons, meanwhile IntegrationFlow is just a " + "logical container for them. \n" + "Consider using [IntegrationFlowContext] for manual registration of IntegrationFlows."); } } } }

return bean; throw new BeanCreationNotAllowedException(name, "Only beans with @ManagedResource or beans which implement " + "org.springframework.context.Lifecycle or org.springframework.util.CustomizableThreadCreator " +

if (singletonObject == null) { if (this.singletonsCurrentlyInDestruction) { throw new BeanCreationNotAllowedException(beanName, "Singleton bean creation not allowed while the singletons of this factory are in destruction " + "(Do not request a bean from a BeanFactory in a destroy method implementation!)");

@Override public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException { for (Class<? extends Annotation> annotationType : INJECTION_ANNOTATIONS) { if (AnnotationUtils.findAnnotation(field, annotationType) != null) { throw new BeanCreationNotAllowedException(beanName, String.format(ERROR, annotationType.getSimpleName(), field.getName(), beanClass.getSimpleName())); } } } });

@Override public void afterSingletonsInstantiated() { for (String beanName : this.beanFactory.getBeanNamesForType(IntegrationFlow.class)) { if (this.beanFactory.containsBeanDefinition(beanName)) { String scope = this.beanFactory.getBeanDefinition(beanName).getScope(); if (StringUtils.hasText(scope) && !BeanDefinition.SCOPE_SINGLETON.equals(scope)) { throw new BeanCreationNotAllowedException(beanName, "IntegrationFlows can not be scoped beans. " + "Any dependant beans are registered as singletons, meanwhile IntegrationFlow is just a " + "logical container for them. \n" + "Consider using [IntegrationFlowContext] for manual registration of IntegrationFlows."); } } } }

return bean; throw new BeanCreationNotAllowedException(name, "Only beans with @ManagedResource or beans which implement " + "org.springframework.context.Lifecycle or org.springframework.util.CustomizableThreadCreator " +

if (singletonObject == null) { if (this.singletonsCurrentlyInDestruction) { throw new BeanCreationNotAllowedException(beanName, "Singleton bean creation not allowed while singletons of this factory are in destruction " + "(Do not request a bean from a BeanFactory in a destroy method implementation!)");

@Override public void afterSingletonsInstantiated() { if (this.beanFactory.containsBean(AbstractApplicationContext.APPLICATION_EVENT_MULTICASTER_BEAN_NAME)) { ApplicationEventMulticaster multicaster = (ApplicationEventMulticaster) this.beanFactory.getBean( AbstractApplicationContext.APPLICATION_EVENT_MULTICASTER_BEAN_NAME); for (ApplicationListener<?> applicationListener : this.applicationListeners) { multicaster.addApplicationListener(applicationListener); } } for (String beanName : this.beanFactory.getBeanNamesForType(IntegrationFlow.class)) { if (this.beanFactory.containsBeanDefinition(beanName)) { String scope = this.beanFactory.getBeanDefinition(beanName).getScope(); if (StringUtils.hasText(scope) && !BeanDefinition.SCOPE_SINGLETON.equals(scope)) { throw new BeanCreationNotAllowedException(beanName, "IntegrationFlows can not be scoped beans. " + "Any dependant beans are registered as singletons, meanwhile IntegrationFlow is just a " + "logical container for them. \n" + "Consider to use [IntegrationFlowContext] for manual registration of IntegrationFlows."); } } } }

@Override public void afterSingletonsInstantiated() { if (this.beanFactory.containsBean(AbstractApplicationContext.APPLICATION_EVENT_MULTICASTER_BEAN_NAME)) { ApplicationEventMulticaster multicaster = (ApplicationEventMulticaster) this.beanFactory.getBean( AbstractApplicationContext.APPLICATION_EVENT_MULTICASTER_BEAN_NAME); for (ApplicationListener<?> applicationListener : this.applicationListeners) { multicaster.addApplicationListener(applicationListener); } } for (String beanName : this.beanFactory.getBeanNamesForType(IntegrationFlow.class)) { if (this.beanFactory.containsBeanDefinition(beanName)) { String scope = this.beanFactory.getBeanDefinition(beanName).getScope(); if (StringUtils.hasText(scope) && !BeanDefinition.SCOPE_SINGLETON.equals(scope)) { throw new BeanCreationNotAllowedException(beanName, "IntegrationFlows can not be scoped beans. " + "Any dependant beans are registered as singletons, meanwhile IntegrationFlow is just a " + "logical container for them. \n" + "Consider to use [IntegrationFlowContext] for manual registration of IntegrationFlows."); } } } }