Skip to content

Commit 075dd7b

Browse files
author
eugenp
committed
further exceptions work
1 parent 429fe66 commit 075dd7b

File tree

14 files changed

+160
-0
lines changed

14 files changed

+160
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package org.baeldung.ex.beancreationexception.cause6;
2+
3+
import org.springframework.stereotype.Component;
4+
5+
@Component
6+
public class BeanA {
7+
private IBeanB dependency;
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package org.baeldung.ex.beancreationexception.cause6;
2+
3+
import org.springframework.stereotype.Component;
4+
5+
@Component
6+
public class BeanB implements IBeanB {
7+
//
8+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package org.baeldung.ex.beancreationexception.cause6;
2+
3+
public interface IBeanB {
4+
//
5+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.baeldung.ex.beancreationexception.cause8;
2+
3+
import org.springframework.beans.factory.annotation.Autowired;
4+
import org.springframework.stereotype.Component;
5+
6+
@Component
7+
public class BeanA implements IBeanA {
8+
private IBeanB beanB;
9+
10+
@Autowired
11+
public BeanA(final IBeanB beanB) {
12+
super();
13+
this.beanB = beanB;
14+
}
15+
16+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package org.baeldung.ex.beancreationexception.cause8;
2+
3+
import org.springframework.beans.factory.annotation.Autowired;
4+
import org.springframework.stereotype.Component;
5+
6+
@Component
7+
public class BeanB implements IBeanB {
8+
final IBeanA beanA;
9+
10+
@Autowired
11+
public BeanB(final IBeanA beanA) {
12+
super();
13+
this.beanA = beanA;
14+
}
15+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package org.baeldung.ex.beancreationexception.cause8;
2+
3+
public interface IBeanA {
4+
//
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package org.baeldung.ex.beancreationexception.cause8;
2+
3+
public interface IBeanB {
4+
//
5+
}

spring-exceptions/src/main/java/org/baeldung/ex/beancreationexception/spring/Cause6ContextWithJavaConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
import org.springframework.context.annotation.ComponentScan;
44
import org.springframework.context.annotation.Configuration;
5+
import org.springframework.context.annotation.ImportResource;
56

67
@Configuration
78
@ComponentScan("org.baeldung.ex.beancreationexception.cause6")
9+
@ImportResource("classpath:beancreationexception_cause6.xml")
810
public class Cause6ContextWithJavaConfig {
911

1012
public Cause6ContextWithJavaConfig() {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package org.baeldung.ex.beancreationexception.spring;
2+
3+
import org.springframework.context.annotation.ComponentScan;
4+
import org.springframework.context.annotation.Configuration;
5+
import org.springframework.context.annotation.ImportResource;
6+
7+
@Configuration
8+
@ComponentScan("org.baeldung.ex.beancreationexception.cause7")
9+
@ImportResource("classpath:beancreationexception_cause7.xml")
10+
public class Cause7ContextWithJavaConfig {
11+
12+
public Cause7ContextWithJavaConfig() {
13+
super();
14+
}
15+
16+
// beans
17+
18+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.baeldung.ex.beancreationexception.spring;
2+
3+
import org.springframework.context.annotation.ComponentScan;
4+
import org.springframework.context.annotation.Configuration;
5+
6+
@Configuration
7+
@ComponentScan("org.baeldung.ex.beancreationexception.cause8")
8+
public class Cause8ContextWithJavaConfig {
9+
10+
public Cause8ContextWithJavaConfig() {
11+
super();
12+
}
13+
14+
// beans
15+
16+
}

0 commit comments

Comments
 (0)