I am applying DebugInterceptor example to learn more about the autoproxy feature.
I have been able to successfully apply the DebugInterceptor using the ProxyFactory in code. Now I want to try and do it with an autoproxy configuration.
It seems easy enough but I get an invalid cast exception.
Any advice?
Thanks,
jeff
System.InvalidCastException: Unable to cast object of type 'CompositionAopProxy_34cf5a029be14c439e4d8755fb96c 726' to type 'PW3Info.baseelement.data.BaseElement'.
Code:BaseElement myBaseElement = (BaseElement) Globals.Factory.GetObject("myBaseElement");Code:<object name="myBaseElement" type="PW3Info.baseelement.data.BaseElement, PW3Info"> <property name="ElementName" value="StoreID" /> <property name="Description" value="The Store Identifier" /> </object> <object id="debugInterceptor" type="PW3Info.aop.DebugInterceptor, PW3Info"> </object> <object id="ProxyCreator" type="Spring.Aop.Framework.AutoProxy.ObjectNameAutoProxyCreator, Spring.Aop"> <property name="ObjectNames"> <list> <value>myBaseElement</value> </list> </property> <property name="InterceptorNames"> <list> <value>debugInterceptor</value> </list> </property> </object>


Reply With Quote

