diff --git a/spring-all/src/main/java/org/baeldung/web/BeanA.java b/spring-all/src/main/java/org/baeldung/web/BeanA.java index f773185bd1..19f1fd2023 100644 --- a/spring-all/src/main/java/org/baeldung/web/BeanA.java +++ b/spring-all/src/main/java/org/baeldung/web/BeanA.java @@ -1,13 +1,11 @@ package org.baeldung.web; -import org.springframework.beans.factory.InitializingBean; import org.springframework.stereotype.Component; @Component -public class BeanA implements InitializingBean { +public class BeanA { - // @Autowired - // private IBeanC dependency; + private IBeanC dependency; public BeanA() { super(); @@ -15,10 +13,4 @@ public class BeanA implements InitializingBean { // - @Override - public void afterPropertiesSet() throws Exception { - System.out.println(); - // throw new NullPointerException(); - } - } diff --git a/spring-all/src/main/java/org/baeldung/web/BeanC.java b/spring-all/src/main/java/org/baeldung/web/BeanB.java similarity index 65% rename from spring-all/src/main/java/org/baeldung/web/BeanC.java rename to spring-all/src/main/java/org/baeldung/web/BeanB.java index c57d30179c..4dd6a2fc7e 100644 --- a/spring-all/src/main/java/org/baeldung/web/BeanC.java +++ b/spring-all/src/main/java/org/baeldung/web/BeanB.java @@ -3,9 +3,9 @@ package org.baeldung.web; import org.springframework.stereotype.Component; @Component -public class BeanC implements IBeanC { +public class BeanB implements IBeanB { - public BeanC() { + public BeanB() { super(); } diff --git a/spring-all/src/main/java/org/baeldung/web/BeanB1.java b/spring-all/src/main/java/org/baeldung/web/BeanC1.java similarity index 64% rename from spring-all/src/main/java/org/baeldung/web/BeanB1.java rename to spring-all/src/main/java/org/baeldung/web/BeanC1.java index b72bce1631..cb3c845a02 100644 --- a/spring-all/src/main/java/org/baeldung/web/BeanB1.java +++ b/spring-all/src/main/java/org/baeldung/web/BeanC1.java @@ -3,9 +3,9 @@ package org.baeldung.web; import org.springframework.stereotype.Component; @Component -public class BeanB1 implements IBeanB { +public class BeanC1 implements IBeanC { - public BeanB1() { + public BeanC1() { super(); } diff --git a/spring-all/src/main/java/org/baeldung/web/BeanB2.java b/spring-all/src/main/java/org/baeldung/web/BeanC2.java similarity index 64% rename from spring-all/src/main/java/org/baeldung/web/BeanB2.java rename to spring-all/src/main/java/org/baeldung/web/BeanC2.java index 232521fc0b..f914384518 100644 --- a/spring-all/src/main/java/org/baeldung/web/BeanB2.java +++ b/spring-all/src/main/java/org/baeldung/web/BeanC2.java @@ -3,9 +3,9 @@ package org.baeldung.web; import org.springframework.stereotype.Component; @Component -public class BeanB2 implements IBeanB { +public class BeanC2 implements IBeanB { - public BeanB2() { + public BeanC2() { super(); } diff --git a/spring-all/src/main/java/org/baeldung/web/BeanD.java b/spring-all/src/main/java/org/baeldung/web/BeanD.java index f1b97b8977..04488238e5 100644 --- a/spring-all/src/main/java/org/baeldung/web/BeanD.java +++ b/spring-all/src/main/java/org/baeldung/web/BeanD.java @@ -1,6 +1,9 @@ package org.baeldung.web; -public abstract class BeanD implements IBeanD { +import org.springframework.stereotype.Component; + +@Component +public class BeanD implements IBeanD { public BeanD() { super(); diff --git a/spring-all/src/main/resources/beansInXml.xml b/spring-all/src/main/resources/beansInXml.xml index 26b55fc183..81ad0a9ecd 100644 --- a/spring-all/src/main/resources/beansInXml.xml +++ b/spring-all/src/main/resources/beansInXml.xml @@ -4,6 +4,8 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd"> - + + + \ No newline at end of file