merry_ploughboy
07-24-2007, 10:36 AM
Hi,
I'm trying to use spring.net (1.1M2) and nhibernate (1.2) and I'm having problems configuring the TransactionProxy.
using: sqlServer2005, .net3.0
my config:
<object id="TxProxyConfigurationTemplate" abstract="true"
type="Spring.Transaction.Interceptor.TransactionProxyFac toryObject, Spring.Data">
<property name="PlatformTransactionManager" ref="HibernateTransactionManager"/>
<property name="TransactionAttributes">
<name-values>
<!-- Add common methods across your services here -->
<add key="Save*" value="PROPAGATION_REQUIRED"/>
<!--
<add key="Delete*" value="PROPAGATION_REQUIRED"/>
-->
</name-values>
</property>
</object>
<object id="AuditTrailServiceTarget" type="Com.XXX.BusinessTier.Impl.AuditTrailServiceImpl, Com.XXX.BusinessTier">
<property name="AuditTrailRecordDao" ref="AuditTrailRecordDao"/>
<property name="TransactionTypeDao" ref="TransactionTypeDao"/>
<property name="TransactionAttributeDao" ref="TransactionAttributeDao" />
<property name="AuditTrailRecordDetailDao" ref="AuditTrailRecordDetailDao"/>
<property name="TransactionTypes">
<dictionary key-type="String" value-type="String">
<entry>
<key>
<value>CREATE_AD_USER</value>
</key>
<value>1</value>
</entry>
<entry>
<key>
<value>ASSIGN_AD_USER_TO_GROUP</value>
</key>
<value>2</value>
</entry>
</dictionary>
</property>
</object>
<object id="AuditTrailService" parent="TxProxyConfigurationTemplate">
<!-- Note: would likely use an anonymous inner object instead of a reference -->
<!-- to ensure that no one can access an unadvised object -->
<property name="Target" ref="AuditTrailServiceTarget"/>
</object>
the error thrown:
[PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested PropertyAccessExceptions are:
[Spring.Objects.TypeMismatchException: Cannot convert property value of type [CompositionAopProxy_9883bace9bd840a5b1eca0ce4624fd a0] to required type [Com.Voestalpine.Cat.Admin.BusinessTier.Impl.AuditT railServiceImpl] for property 'AuditTrailService'., Inner Exception: Spring.Objects.TypeMismatchException: Cannot convert property value of type [CompositionAopProxy_9883bace9bd840a5b1eca0ce4624fd a0] to required type [Com.Voestalpine.Cat.Admin.BusinessTier.Impl.AuditT railServiceImpl] for property 'AuditTrailService'.
bei Spring.Util.ConversionUtils.ConvertValueIfNecessar y(Type requiredType, Object newValue, String propertyName)]]
Spring.Objects.ObjectWrapper.SetPropertyValues(IPr opertyValues propertyValues, Boolean ignoreUnknown) +948
Spring.Objects.ObjectWrapper.SetPropertyValues(IPr opertyValues pvs) +31
Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.ApplyPropertyValues(String name, RootObjectDefinition definition, IObjectWrapper wrapper, IPropertyValues properties) +392
[ObjectCreationException: Error creating object with name 'UserService' defined in 'file [C:\projects\CAT\com.voestalpine.cat.admin\com.voes talpine.cat.admin\Config\spring-services.xml]' : Error setting property values: PropertyAccessExceptionsException (1 errors); nested PropertyAccessExceptions are:
[Spring.Objects.TypeMismatchException: Cannot convert property value of type [CompositionAopProxy_9883bace9bd840a5b1eca0ce4624fd a0] to required type [Com.Voestalpine.Cat.Admin.BusinessTier.Impl.AuditT railServiceImpl] for property 'AuditTrailService'., Inner Exception: Spring.Objects.TypeMismatchException: Cannot convert property value of type [CompositionAopProxy_9883bace9bd840a5b1eca0ce4624fd a0] to required type [Com.Voestalpine.Cat.Admin.BusinessTier.Impl.AuditT railServiceImpl] for property 'AuditTrailService'.
bei Spring.Util.ConversionUtils.ConvertValueIfNecessar y(Type requiredType, Object newValue, String propertyName)]]
Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.ApplyPropertyValues(String name, RootObjectDefinition definition, IObjectWrapper wrapper, IPropertyValues properties) +492
Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.PopulateObject(String name, RootObjectDefinition definition, IObjectWrapper wrapper) +308
Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.ConfigureObject(String name, RootObjectDefinition definition, IObjectWrapper wrapper) +146
Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.CreateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching) +920
Spring.Objects.Factory.Support.WebObjectFactory.Cr eateAndCacheSingletonInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments) +186
Spring.Objects.Factory.Support.AbstractObjectFacto ry.GetObject(String name, Type requiredType, Object[] arguments) +622
Spring.Objects.Factory.Support.AbstractObjectFacto ry.GetObject(String name, Object[] arguments) +64
Spring.Objects.Factory.Support.AbstractObjectFacto ry.GetObject(String name) +40
Spring.Objects.Factory.Support.DefaultListableObje ctFactory.PreInstantiateSingletons() +632
Spring.Context.Support.AbstractApplicationContext. Refresh() +877
Spring.Context.Support.WebApplicationContext..ctor (String name, Boolean caseSensitive, IApplicationContext parentContext, String[] configurationLocations) +87
Spring.Context.Support.WebApplicationContext..ctor (String name, Boolean caseSensitive, String[] configurationLocations) +41
I've tried almost every configuration in the documentation and I either end up with the error above, or with a transaction that is not commited to the database.
Can someone shed light on this issue for me?
thx
mp
I'm trying to use spring.net (1.1M2) and nhibernate (1.2) and I'm having problems configuring the TransactionProxy.
using: sqlServer2005, .net3.0
my config:
<object id="TxProxyConfigurationTemplate" abstract="true"
type="Spring.Transaction.Interceptor.TransactionProxyFac toryObject, Spring.Data">
<property name="PlatformTransactionManager" ref="HibernateTransactionManager"/>
<property name="TransactionAttributes">
<name-values>
<!-- Add common methods across your services here -->
<add key="Save*" value="PROPAGATION_REQUIRED"/>
<!--
<add key="Delete*" value="PROPAGATION_REQUIRED"/>
-->
</name-values>
</property>
</object>
<object id="AuditTrailServiceTarget" type="Com.XXX.BusinessTier.Impl.AuditTrailServiceImpl, Com.XXX.BusinessTier">
<property name="AuditTrailRecordDao" ref="AuditTrailRecordDao"/>
<property name="TransactionTypeDao" ref="TransactionTypeDao"/>
<property name="TransactionAttributeDao" ref="TransactionAttributeDao" />
<property name="AuditTrailRecordDetailDao" ref="AuditTrailRecordDetailDao"/>
<property name="TransactionTypes">
<dictionary key-type="String" value-type="String">
<entry>
<key>
<value>CREATE_AD_USER</value>
</key>
<value>1</value>
</entry>
<entry>
<key>
<value>ASSIGN_AD_USER_TO_GROUP</value>
</key>
<value>2</value>
</entry>
</dictionary>
</property>
</object>
<object id="AuditTrailService" parent="TxProxyConfigurationTemplate">
<!-- Note: would likely use an anonymous inner object instead of a reference -->
<!-- to ensure that no one can access an unadvised object -->
<property name="Target" ref="AuditTrailServiceTarget"/>
</object>
the error thrown:
[PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested PropertyAccessExceptions are:
[Spring.Objects.TypeMismatchException: Cannot convert property value of type [CompositionAopProxy_9883bace9bd840a5b1eca0ce4624fd a0] to required type [Com.Voestalpine.Cat.Admin.BusinessTier.Impl.AuditT railServiceImpl] for property 'AuditTrailService'., Inner Exception: Spring.Objects.TypeMismatchException: Cannot convert property value of type [CompositionAopProxy_9883bace9bd840a5b1eca0ce4624fd a0] to required type [Com.Voestalpine.Cat.Admin.BusinessTier.Impl.AuditT railServiceImpl] for property 'AuditTrailService'.
bei Spring.Util.ConversionUtils.ConvertValueIfNecessar y(Type requiredType, Object newValue, String propertyName)]]
Spring.Objects.ObjectWrapper.SetPropertyValues(IPr opertyValues propertyValues, Boolean ignoreUnknown) +948
Spring.Objects.ObjectWrapper.SetPropertyValues(IPr opertyValues pvs) +31
Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.ApplyPropertyValues(String name, RootObjectDefinition definition, IObjectWrapper wrapper, IPropertyValues properties) +392
[ObjectCreationException: Error creating object with name 'UserService' defined in 'file [C:\projects\CAT\com.voestalpine.cat.admin\com.voes talpine.cat.admin\Config\spring-services.xml]' : Error setting property values: PropertyAccessExceptionsException (1 errors); nested PropertyAccessExceptions are:
[Spring.Objects.TypeMismatchException: Cannot convert property value of type [CompositionAopProxy_9883bace9bd840a5b1eca0ce4624fd a0] to required type [Com.Voestalpine.Cat.Admin.BusinessTier.Impl.AuditT railServiceImpl] for property 'AuditTrailService'., Inner Exception: Spring.Objects.TypeMismatchException: Cannot convert property value of type [CompositionAopProxy_9883bace9bd840a5b1eca0ce4624fd a0] to required type [Com.Voestalpine.Cat.Admin.BusinessTier.Impl.AuditT railServiceImpl] for property 'AuditTrailService'.
bei Spring.Util.ConversionUtils.ConvertValueIfNecessar y(Type requiredType, Object newValue, String propertyName)]]
Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.ApplyPropertyValues(String name, RootObjectDefinition definition, IObjectWrapper wrapper, IPropertyValues properties) +492
Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.PopulateObject(String name, RootObjectDefinition definition, IObjectWrapper wrapper) +308
Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.ConfigureObject(String name, RootObjectDefinition definition, IObjectWrapper wrapper) +146
Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.CreateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching) +920
Spring.Objects.Factory.Support.WebObjectFactory.Cr eateAndCacheSingletonInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments) +186
Spring.Objects.Factory.Support.AbstractObjectFacto ry.GetObject(String name, Type requiredType, Object[] arguments) +622
Spring.Objects.Factory.Support.AbstractObjectFacto ry.GetObject(String name, Object[] arguments) +64
Spring.Objects.Factory.Support.AbstractObjectFacto ry.GetObject(String name) +40
Spring.Objects.Factory.Support.DefaultListableObje ctFactory.PreInstantiateSingletons() +632
Spring.Context.Support.AbstractApplicationContext. Refresh() +877
Spring.Context.Support.WebApplicationContext..ctor (String name, Boolean caseSensitive, IApplicationContext parentContext, String[] configurationLocations) +87
Spring.Context.Support.WebApplicationContext..ctor (String name, Boolean caseSensitive, String[] configurationLocations) +41
I've tried almost every configuration in the documentation and I either end up with the error above, or with a transaction that is not commited to the database.
Can someone shed light on this issue for me?
thx
mp