BAEL-8964 Add a section in "NoSuchBeanDefinition" article

- Added example for no such bean definition example.
This commit is contained in:
Dhawal Kapil 2018-09-13 22:16:08 +05:30
parent 977c50ad85
commit 0ff98874f7
3 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,12 @@
package com.baeldung.springbootmvc.nosuchbeandefinitionexception;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class BeanA {
@Autowired
BeanB dependency;
}

View File

@ -0,0 +1,5 @@
package com.baeldung.springbootmvc.nosuchbeandefinitionexception;
public class BeanB {
}

View File

@ -0,0 +1,12 @@
package com.baeldung.springbootmvc.nosuchbeandefinitionexception;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class NoSuchBeanDefinitionDemoApp {
public static void main(String[] args) {
SpringApplication.run(NoSuchBeanDefinitionDemoApp.class, args);
}
}