Day: November 3, 2015

When Autowiring Spring Beans, a common exception is a BeanCreationException. This means that Spring found a bean to create, but was unable to fulfill the dependencies needed to create this this Spring bean. Here is an example of a BeanCreationException: BeanCreationException Exception in thread “main” org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘helloController’: Injection of autowired […]Continue reading

When Autowiring Spring Beans, a common error is to see a NoSuchBeanDefinitionException. Here is an example of the NoSuchBeanDefinitionException you may see thrown by the Spring context: NoSuchBeanDefinitionException Exception in thread “main” org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [guru.springframework.controllers.HelloController] is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:372) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:332) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1060) By default, Spring will Autowire beans by type. You […]Continue reading