Package org.springframework.beans.factory

Examples of org.springframework.beans.factory.NoSuchBeanDefinitionException


                maybeLogGetDependentBean(name, applicationContext);
                return applicationContext.getBean(name, requiredType);
            }
        }

        throw new NoSuchBeanDefinitionException(name);
    }
View Full Code Here


                maybeLogGetDependentBean(name, applicationContext);            
                return applicationContext.getBean(name, args);
            }
        }

        throw new NoSuchBeanDefinitionException(name);
    }
View Full Code Here

                maybeLogGetDependentBean(name, applicationContext);
                return applicationContext.getBean(name);
            }
        }
       
        throw new NoSuchBeanDefinitionException(name);
    }
View Full Code Here

                maybeLogGetDependentBean(name, applicationContext);
                return applicationContext.getBean(name, requiredType);
            }
        }

        throw new NoSuchBeanDefinitionException(name);
    }
View Full Code Here

                maybeLogGetDependentBean(name, applicationContext);            
                return applicationContext.getBean(name, args);
            }
        }

        throw new NoSuchBeanDefinitionException(name);
    }
View Full Code Here

        verify(applicationContext);
    }

    public void testNoSuchBeanDef() throws Exception {
       
        expect(applicationContext.getBean("beanName")).andThrow(new NoSuchBeanDefinitionException("beanName"));
       
        replay(applicationContext);
       
        factoryBean.afterPropertiesSet();
        assertEquals(fallback, factoryBean.getObject());
View Full Code Here

    this.beanFactory = beanFactory;
    if (this.targetBeanName == null) {
      throw new IllegalArgumentException("'targetBeanName' is required");
    }
    if (!this.beanFactory.containsBean(this.targetBeanName)) {
      throw new NoSuchBeanDefinitionException(this.targetBeanName, this.beanFactory.toString());
    }
  }
View Full Code Here

public class StrictBeanMap extends BeanMap {

    public Object getBean(String name) throws BeansException {
        Object object = super.getBean(name);
        if (object == null) {
            throw new NoSuchBeanDefinitionException(name);
        }
        return object;
    }
View Full Code Here

    }
    if (this.alwaysUseJndiLookup) {
      return this.jndiFactory.getBean(element.name, element.lookupType);
    }
    if (this.resourceFactory == null) {
      throw new NoSuchBeanDefinitionException(element.lookupType,
          "No resource factory configured - specify the 'resourceFactory' property");
    }
    return autowireResource(this.resourceFactory, element, requestingBeanName);
  }
View Full Code Here

            ((ConfigurableBeanFactory) beanFactory).registerDependentBean(this.beanName, requestingBeanName);
          }
          return bean;
        }
        else if (this.isDefaultName && !StringUtils.hasLength(this.mappedName)) {
          throw new NoSuchBeanDefinitionException(this.beanName,
              "Cannot resolve 'beanName' in local BeanFactory. Consider specifying a general 'name' value instead.");
        }
      }
      // JNDI name lookup - may still go to a local BeanFactory.
      return getResource(this, requestingBeanName);
View Full Code Here

TOP

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

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.