spring - Proxy and Concrete Class in Java -


consider junit code

xxximpl xxximpl=(xxximpl) new classpathxmlapplicationcontext(context).getbean("xxxx"); 

it throws exception:

java.lang.classcastexception: $proxy42 incompatible com.zzz.yyy.xxximpl

when classpathxmlapplicationcontext(context)getbean("xxx").getclass() gives $proxy 42.

i have similar setup in application getclass returns concrete class "xxx" instead of $proxy 42.

when searched error, mentioned classloaders. looked @ class path not find issue.

can guide why 2 applications similar setup - 1 returns proxy , other returns concrete class.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -