Skip to content

Commit 0ff9887

Browse files
committed
BAEL-8964 Add a section in "NoSuchBeanDefinition" article
- Added example for no such bean definition example.
1 parent 977c50a commit 0ff9887

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.baeldung.springbootmvc.nosuchbeandefinitionexception;
2+
3+
import org.springframework.beans.factory.annotation.Autowired;
4+
import org.springframework.stereotype.Component;
5+
6+
@Component
7+
public class BeanA {
8+
9+
@Autowired
10+
BeanB dependency;
11+
12+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.baeldung.springbootmvc.nosuchbeandefinitionexception;
2+
3+
public class BeanB {
4+
5+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.baeldung.springbootmvc.nosuchbeandefinitionexception;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
6+
@SpringBootApplication
7+
public class NoSuchBeanDefinitionDemoApp {
8+
9+
public static void main(String[] args) {
10+
SpringApplication.run(NoSuchBeanDefinitionDemoApp.class, args);
11+
}
12+
}

0 commit comments

Comments
 (0)