Mike Plavsky
06-21-2007, 02:20 PM
when I am trying to replace public virtual method in the class by implementing IMethodReplacer, I am getting the following error when loading application context from xml file:
Test method TestSpring.AopLoggingTest.TestLogging threw exception: Spring.Objects.Factory.ObjectCreationException: Error creating object with name 'SourcePermissions' defined in 'assembly [TestSpring, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [TestSpring.Resources.autoProxyLogging.xml]' : Initialization of object failed : Declaration referenced in a method implementation cannot be a final method. Type: 'DecoratorAopProxy_0f74d1e826c240c790b18c2b2fc0618 0'. Assembly: 'Spring.Proxy, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. ---> System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method. Type: 'DecoratorAopProxy_0f74d1e826c240c790b18c2b2fc0618 0'. Assembly: 'Spring.Proxy, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'..
With the following Stack Trace:
at System.Reflection.Emit.TypeBuilder.TermCreateClass (Int32 handle, Module module)
at System.Reflection.Emit.TypeBuilder.CreateTypeNoLoc k()
at System.Reflection.Emit.TypeBuilder.CreateType()
at Spring.Aop.Framework.DynamicProxy.DecoratorAopProx yTypeBuilder.BuildProxyType()
at Spring.Aop.Framework.DefaultAopProxyFactory.Create AopProxy(AdvisedSupport advisedSupport)
at Spring.Aop.Framework.AdvisedSupport.CreateAopProxy ()
at Spring.Aop.Framework.ProxyFactory.GetProxy()
at Spring.Aop.Framework.AutoProxy.AbstractAutoProxyCr eator.PostProcessAfterInitialization(Object obj, String name)
at Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.ApplyObjectPostProcessorsAfterIn itialization(Object instance, String name)
at Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.ConfigureObject(String name, RootObjectDefinition definition, IObjectWrapper wrapper)
at Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.CreateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching)
--- End of inner exception stack trace ---
at Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.CreateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching)
at Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.CreateObject(String name, RootObjectDefinition definition, Object[] arguments)
at Spring.Objects.Factory.Support.AbstractObjectFacto ry.CreateAndCacheSingletonInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments)
at Spring.Objects.Factory.Support.AbstractObjectFacto ry.GetObject(String name, Type requiredType, Object[] arguments)
at Spring.Objects.Factory.Support.AbstractObjectFacto ry.GetObject(String name, Object[] arguments)
at Spring.Objects.Factory.Support.DefaultListableObje ctFactory.PreInstantiateSingletons()
at Spring.Context.Support.AbstractApplicationContext. Refresh()
at Spring.Context.Support.XmlApplicationContext..ctor (String[] configurationLocations)
at TestSpring.AopLoggingTest.TestLogging() in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\TestSpring\TestSpring\AopLoggingTest .cs:line 26
Test method TestSpring.AopLoggingTest.TestLogging threw exception: Spring.Objects.Factory.ObjectCreationException: Error creating object with name 'SourcePermissions' defined in 'assembly [TestSpring, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [TestSpring.Resources.autoProxyLogging.xml]' : Initialization of object failed : Declaration referenced in a method implementation cannot be a final method. Type: 'DecoratorAopProxy_0f74d1e826c240c790b18c2b2fc0618 0'. Assembly: 'Spring.Proxy, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. ---> System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method. Type: 'DecoratorAopProxy_0f74d1e826c240c790b18c2b2fc0618 0'. Assembly: 'Spring.Proxy, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'..
With the following Stack Trace:
at System.Reflection.Emit.TypeBuilder.TermCreateClass (Int32 handle, Module module)
at System.Reflection.Emit.TypeBuilder.CreateTypeNoLoc k()
at System.Reflection.Emit.TypeBuilder.CreateType()
at Spring.Aop.Framework.DynamicProxy.DecoratorAopProx yTypeBuilder.BuildProxyType()
at Spring.Aop.Framework.DefaultAopProxyFactory.Create AopProxy(AdvisedSupport advisedSupport)
at Spring.Aop.Framework.AdvisedSupport.CreateAopProxy ()
at Spring.Aop.Framework.ProxyFactory.GetProxy()
at Spring.Aop.Framework.AutoProxy.AbstractAutoProxyCr eator.PostProcessAfterInitialization(Object obj, String name)
at Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.ApplyObjectPostProcessorsAfterIn itialization(Object instance, String name)
at Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.ConfigureObject(String name, RootObjectDefinition definition, IObjectWrapper wrapper)
at Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.CreateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching)
--- End of inner exception stack trace ---
at Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.CreateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching)
at Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.CreateObject(String name, RootObjectDefinition definition, Object[] arguments)
at Spring.Objects.Factory.Support.AbstractObjectFacto ry.CreateAndCacheSingletonInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments)
at Spring.Objects.Factory.Support.AbstractObjectFacto ry.GetObject(String name, Type requiredType, Object[] arguments)
at Spring.Objects.Factory.Support.AbstractObjectFacto ry.GetObject(String name, Object[] arguments)
at Spring.Objects.Factory.Support.DefaultListableObje ctFactory.PreInstantiateSingletons()
at Spring.Context.Support.AbstractApplicationContext. Refresh()
at Spring.Context.Support.XmlApplicationContext..ctor (String[] configurationLocations)
at TestSpring.AopLoggingTest.TestLogging() in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\TestSpring\TestSpring\AopLoggingTest .cs:line 26