Package org.springframework.beans.factory

Examples of org.springframework.beans.factory.NoSuchBeanDefinitionException


    expect(servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE))
        .andReturn(wac);
    expect(wac.isSingleton("beanName")).andReturn(false);
    expect(wac.getBean("beanName", TestAction.class)).andThrow(
        new NoSuchBeanDefinitionException("beanName", "message"));

    replay(servletContext);
    replay(wac);

    SpringActionBeanSource source = new SpringActionBeanSource(actionBeanClass, "beanName");
View Full Code Here


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

  {
    Iterator<T> beans = getBeansOfType(requiredType).values().iterator();

    if (beans.hasNext() == false)
    {
      throw new NoSuchBeanDefinitionException("bean of required type " + requiredType +
        " not found");
    }
    final T bean = beans.next();

    if (beans.hasNext() != false)
    {
      throw new NoSuchBeanDefinitionException("more than one bean of required type " +
        requiredType + " found");
    }
    return bean;
  }
View Full Code Here

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

  {
    Iterator<T> beans = getBeansOfType(requiredType).values().iterator();

    if (beans.hasNext() == false)
    {
      throw new NoSuchBeanDefinitionException("bean of required type " + requiredType +
        " not found");
    }
    final T bean = beans.next();

    if (beans.hasNext() != false)
    {
      throw new NoSuchBeanDefinitionException("more than one bean of required type " +
        requiredType + " found");
    }
    return bean;
  }
View Full Code Here

            endpoint = camelContext.getEndpoint(uri);
        } else {
            if (isNotNullAndNonEmpty(name)) {
                endpoint = (Endpoint)applicationContext.getBean(name);
                if (endpoint == null) {
                    throw new NoSuchBeanDefinitionException(name);
                }
            } else {
                LOG.warn("No uri or name specified on @EndpointInject annotation!");
            }
        }
View Full Code Here

        Object bean = implementation.getBean(name, requiredType);
        if (bean == null && getParent() != null) {
            bean = getParent().getBean(name, requiredType);
        }
        if (bean == null) {
            throw new NoSuchBeanDefinitionException("Unable to find Bean with name " + name);
        } else {
            return bean;
        }
    } // end method getBean( String, Class )
View Full Code Here

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

        ConnectorObject after = null;

        try {
            final ConnectorFacadeProxy connector = connLoader.getConnector(task.getResource());
            if (connector == null) {
                throw new NoSuchBeanDefinitionException(String.format(
                        "Connector instance bean for resource %s not found", task.getResource()));
            }

            // Try to read user BEFORE any actual operation
            before = getRemoteObject(connector, task, false);
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

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.