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
Post a Comment