This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting $Proxy0 cannot be cast exception

 
sirisha mullapudi
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have implemented BeanNameAware Interface and i am trying to access the bean using ApplicationContext.There i am getting exception $Proxy0 cannot be cast to net.springtest.SimpleBean. I am new to Spring framework.I have read that applicationcontext provides all the features that bean factory has.But here i am able to load the bean using BeanFactory but not ApplicationContext. Can you please describe what exactly proxy meant here and in what situations we should use bean factory and applicationContext. Appreciate your Help.

Regards,
Sireesha
 
Ankit Garg
Sheriff
Posts: 9497
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must be using some sort of AOP I think so you are getting a proxy object. Can you show us your spring configuration file...
 
sirisha mullapudi
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,please find the xml below :

Thanks,
Sireesha
 
Ankit Garg
Sheriff
Posts: 9497
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes indeed you are using AOP. In that case you'll have to create a base interface of SimpleBean class and use that interface as reference when you get the simpleBean from ApplicationContext...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic