further exceptions work
This commit is contained in:
+5
@@ -0,0 +1,5 @@
|
||||
package org.baeldung.ex.beancreationexception.cause9;
|
||||
|
||||
public abstract class BeanA implements IBeanA {
|
||||
//
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package org.baeldung.ex.beancreationexception.cause9;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class BeanB {
|
||||
//
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package org.baeldung.ex.beancreationexception.cause9;
|
||||
|
||||
public interface IBeanA {
|
||||
//
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package org.baeldung.ex.beancreationexception.spring;
|
||||
|
||||
import org.baeldung.ex.beancreationexception.cause9.BeanB;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.beancreationexception.cause9")
|
||||
@ImportResource("classpath:beancreationexception_cause9.xml")
|
||||
public class Cause9ContextWithJavaConfig {
|
||||
@Autowired
|
||||
BeanFactory beanFactory;
|
||||
|
||||
public Cause9ContextWithJavaConfig() {
|
||||
super();
|
||||
}
|
||||
|
||||
// beans
|
||||
|
||||
@Bean
|
||||
public BeanB beanB() {
|
||||
beanFactory.getBean("beanA");
|
||||
return new BeanB();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user