lahma
11-18-2006, 05:44 PM
Hi,
Again I seem to have problems with exporting proxied objects :) I have configuration which is like this (some details removed):
<object id="baseService" type="Spring.Transaction.Interceptor.TransactionProxyFac toryObject, Spring.Data" abstract="true">
<property name="PlatformTransactionManager" ref="transactionManager" />
<property name="TransactionAttributeSource" ref="attributeTransactionAttributeSource"/>
</object>
and a proxy like this:
<object id="userManagement" parent="baseService">
<property name="Target">
<ref object="userManagementImpl"/>
</property>
</object>
and remoting configuration:
<object id="remotedUserManagement" type="Spring.Remoting.SaoExporter, Spring.Services">
<property name="Infinite" value="true" />
<property name="TargetName" value="userManagement"/>
<property name="ServiceName" value="UserManagement.rem"/>
</object>
And implementation class has method with Transaction attribute decorated:
[Transaction()]
public void DoIt()
{
...
}
Now when I try to export my proxy I always get:
Spring.Objects.Factory.ObjectCreationException: Error creating object with name 'remotedUserManagement' defined in 'assembly [My.Assembly, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null], resource [spring-remoting.xml]' : Initialization of object failed : 'RollbackFor' property specified was not found.
---> System.Reflection.CustomAttributeFormatException: 'RollbackFor' property specified was not found. ---> System.NullReferenceException: Object reference not set to an instance of an object. at System.Reflection.CustomAttribute.GetCustomAttribu tes(Module decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)
--- End of inner exception stack trace ---
at System.Reflection.CustomAttribute.GetCustomAttribu tes(Module decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeTypeattributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)
at System.Reflection.CustomAttribute.GetCustomAttribu tes(RuntimeMethodInfo method, RuntimeType caType, Boolean inherit)
at System.Reflection.RuntimeMethodInfo.GetCustomAttri butes(Boolean inherit)
at Spring.Proxy.AbstractProxyTypeBuilder.GetMethodAtt ributes(MethodInfo method)
at Spring.Proxy.AbstractProxyTypeBuilder.ApplyCustomA ttributes(MethodBuilderbuilder, MethodInfo targetMethod)
at Spring.Proxy.AbstractProxyTypeBuilder.ImplementInt erface(TypeBuilder typeBuilder, IProxyMethodBuilder proxyMethodBuilder, Type intf, Type targetType, Boolean proxyVirtualMethods)
at Spring.Proxy.AbstractProxyTypeBuilder.ImplementInt erface(TypeBuilder typeBuilder, IProxyMethodBuilder proxyMethodBuilder, Type intf, Type targetType)
at Spring.Proxy.CompositionProxyTypeBuilder.BuildProx yType()
at Spring.Remoting.Support.RemoteObjectProxyTypeBuild er.BuildProxyType()
at Spring.Remoting.SaoExporter.Export()
at Spring.Remoting.SaoExporter.AfterPropertiesSet()
at Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.Invoke
InitMethods(Object target, String name, IConfigurableObjectDefinition definition
)
This is the same with normal ProxyFactoryObject too. What am I doing wrong? :(
Again I seem to have problems with exporting proxied objects :) I have configuration which is like this (some details removed):
<object id="baseService" type="Spring.Transaction.Interceptor.TransactionProxyFac toryObject, Spring.Data" abstract="true">
<property name="PlatformTransactionManager" ref="transactionManager" />
<property name="TransactionAttributeSource" ref="attributeTransactionAttributeSource"/>
</object>
and a proxy like this:
<object id="userManagement" parent="baseService">
<property name="Target">
<ref object="userManagementImpl"/>
</property>
</object>
and remoting configuration:
<object id="remotedUserManagement" type="Spring.Remoting.SaoExporter, Spring.Services">
<property name="Infinite" value="true" />
<property name="TargetName" value="userManagement"/>
<property name="ServiceName" value="UserManagement.rem"/>
</object>
And implementation class has method with Transaction attribute decorated:
[Transaction()]
public void DoIt()
{
...
}
Now when I try to export my proxy I always get:
Spring.Objects.Factory.ObjectCreationException: Error creating object with name 'remotedUserManagement' defined in 'assembly [My.Assembly, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null], resource [spring-remoting.xml]' : Initialization of object failed : 'RollbackFor' property specified was not found.
---> System.Reflection.CustomAttributeFormatException: 'RollbackFor' property specified was not found. ---> System.NullReferenceException: Object reference not set to an instance of an object. at System.Reflection.CustomAttribute.GetCustomAttribu tes(Module decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)
--- End of inner exception stack trace ---
at System.Reflection.CustomAttribute.GetCustomAttribu tes(Module decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeTypeattributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)
at System.Reflection.CustomAttribute.GetCustomAttribu tes(RuntimeMethodInfo method, RuntimeType caType, Boolean inherit)
at System.Reflection.RuntimeMethodInfo.GetCustomAttri butes(Boolean inherit)
at Spring.Proxy.AbstractProxyTypeBuilder.GetMethodAtt ributes(MethodInfo method)
at Spring.Proxy.AbstractProxyTypeBuilder.ApplyCustomA ttributes(MethodBuilderbuilder, MethodInfo targetMethod)
at Spring.Proxy.AbstractProxyTypeBuilder.ImplementInt erface(TypeBuilder typeBuilder, IProxyMethodBuilder proxyMethodBuilder, Type intf, Type targetType, Boolean proxyVirtualMethods)
at Spring.Proxy.AbstractProxyTypeBuilder.ImplementInt erface(TypeBuilder typeBuilder, IProxyMethodBuilder proxyMethodBuilder, Type intf, Type targetType)
at Spring.Proxy.CompositionProxyTypeBuilder.BuildProx yType()
at Spring.Remoting.Support.RemoteObjectProxyTypeBuild er.BuildProxyType()
at Spring.Remoting.SaoExporter.Export()
at Spring.Remoting.SaoExporter.AfterPropertiesSet()
at Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.Invoke
InitMethods(Object target, String name, IConfigurableObjectDefinition definition
)
This is the same with normal ProxyFactoryObject too. What am I doing wrong? :(