BeanIsNotAFactoryException: Bean named must be of type




Asked on April 25, 2013
Hi All,

Need suggestion for the below error.

Exception in thread "main" org.springframework.beans.factory.BeanIsNotAFactoryException: Bean named must be of type [org.springframework.beans.factory.FactoryBean], but was actually of type 
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1419)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1093)




Replied on April 25, 2013
Error is obvious that BeanIsNotAFactoryException.
Elaborate exactly what are you doing.



Replied on April 25, 2013
I am accessing factory bean by ampersand(&) and got the error.


Replied on April 25, 2013
It seems that the bean id for which you are prefixing ampersand could be a normal bean not a factory bean. Check at your end. Find the url for your help.
http://www.concretepage.com/spring/factorybean_ampersand_spring.php



Write Answer











©2024 concretepage.com | Privacy Policy | Contact Us