When you have input like this below
ApplicationContext applicationContext = new ClassPathXmlApplicationContext();
you get output like
Exception in thread "main" java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
Hence you have to define the bean in the ClassPathXmlApplicationContext("SpringBeans.xml");
ApplicationContext applicationContext = new ClassPathXmlApplicationContext();
you get output like
Exception in thread "main" java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
Hence you have to define the bean in the ClassPathXmlApplicationContext("SpringBeans.xml");
No comments:
Post a Comment