Package org.springframework.beans.factory

Examples of org.springframework.beans.factory.NoSuchBeanDefinitionException


            if (isNullOrBlank(name)) {
                name = injectionPointName;
            }
            endpoint = (Endpoint) applicationContext.getBean(name);
            if (endpoint == null) {
                throw new NoSuchBeanDefinitionException(name);
            }
        }
        return endpoint;
    }
View Full Code Here


   public Object getBean(String name) throws BeansException
   {
      ControllerContext context = getInstalledContext(name);
      if (context == null)
         throw new NoSuchBeanDefinitionException(name);

      return context.getTarget();
   }
View Full Code Here

   @SuppressWarnings("deprecation")
   public Class getType(String name) throws NoSuchBeanDefinitionException
   {
      ControllerContext context = getContext(name, ControllerState.DESCRIBED);
      if (context == null)
         throw new NoSuchBeanDefinitionException(name);

      if (context instanceof KernelControllerContext)
      {
         KernelControllerContext kcc = (KernelControllerContext)context;
         BeanInfo beanInfo = kcc.getBeanInfo();
View Full Code Here

    return result;
  }
  private Component findComponent(String name){
    final Component c = yan.getComponent(name);
    if(c==null){
      throw new NoSuchBeanDefinitionException(name, "bean "+name+" not found.");
    }
    return c;
  }
View Full Code Here

      //return FactoryBean
      final String factoryname = BeanFactoryUtils.transformedBeanName(beanname);
      final Component c = findComponent(factoryname);
      final Component fbc = SpringAdapter.getFactoryBeanComponent(c);
      if(fbc!=null){
        throw new NoSuchBeanDefinitionException(beanname,
            "FactoryBean "+factoryname+" not found.");
      }
      final Object result = instantiate(fbc);
      checkBeanInstanceType(beanname, requiredType, result);
      return result;
View Full Code Here

        ((ConfigurableBeanFactory) this.beanFactory).registerDependentBean(unitName, requestingBeanName);
      }
      return (EntityManagerFactory) entry.getValue();
    }
    else {
      throw new NoSuchBeanDefinitionException(
          EntityManagerFactory.class, "expected single bean but found " + matchingBeans.size());
    }
  }
View Full Code Here

            return beans.containsKey(name);
        }
        public String[] getAliases(String name) throws NoSuchBeanDefinitionException {
            Object bean = beans.get(name);
            if (bean == null) {
                throw new NoSuchBeanDefinitionException(name);
            }
            return new String[0];
        }
View Full Code Here

            return getBean(name, null);
        }
        public Object getBean(String name, Class requiredType) throws BeansException {
            Object bean = beans.get(name);
            if (bean == null) {
                throw new NoSuchBeanDefinitionException(name);
            }
            if (requiredType != null && !requiredType.isInstance(bean)) {
                throw new BeanNotOfRequiredTypeException(name, requiredType, bean.getClass());
            }
            return bean;
View Full Code Here

            return bean;
        }
        public Class getType(String name) throws NoSuchBeanDefinitionException {
            Object bean = beans.get(name);
            if (bean == null) {
                throw new NoSuchBeanDefinitionException(name);
            }
            return bean.getClass();
        }
View Full Code Here

            return bean.getClass();
        }
        public boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
            Object bean = beans.get(name);
            if (bean == null) {
                throw new NoSuchBeanDefinitionException(name);
            }
            return true;
        }
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.