Home  >  Forum  >  Spring
Post New Query

BeanIsNotAFactoryException: Bean named must be of type


joined on
April 07,2013
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)

joined on
March 18,2013
Replied on April 25,2013

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

I am accessing factory bean by ampersand(&) and got the error.
joined on
March 18,2013
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








Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us