PDA

View Full Version : AOP & Remoting


michael.stephenson
04-21-2006, 11:36 PM
Hi,

I have implemented a remoting service using Spring.Services with the config as follows:

<objects>

<object id="BasicLoggingAroundAdvice" type="Logging.Logger" />



<object
id="Acme.PetShop.Model.ServiceInterfaces.IAccountServi ce"
type="Spring.Remoting.SaoFactoryObject, Spring.Services">
<property
name="ServiceInterface"
value="Acme.PetShop.Model.ServiceInterfaces.IAccountServi ce, Acme.PetShop.Model"/>
<property
name="ServiceUri"
value="http://localhost:1402/AccountService.soap"/>
</object>
</objects>

This works fine, and i have also tested else where the advice object and know this works.

My next step was to wrap the remoting object with the LoggingAroundAdvice using the Spring AOP implementation, i have done this else where successfully so i expected that configuring it like below would work fine:

<objects>

<object id="BasicLoggingAroundAdvice" type="Edenbrook.Blueprint.Logging.BasicLoggingAroundAdvi ce, Edenbrook.Blueprint" />


<object
id="Acme.PetShop.Model.ServiceInterfaces.IAccountServi ce"
type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
<property name="target">
<object
id="RemotedIAccountService"
type="Spring.Remoting.SaoFactoryObject, Spring.Services">
<property
name="ServiceInterface"
value="Acme.PetShop.Model.ServiceInterfaces.IAccountServi ce, Acme.PetShop.Model"/>
<property
name="ServiceUri"
value="http://localhost:1402/AccountService.soap"/>
</object>
</property>
<property name="interceptorNames">
<list>
<value>BasicLoggingAroundAdvice</value>
</list>
</property>
</object>
</objects>

When i tried to run the example like this i get the following error:

"Cannot create an instance of Spring.Aop.DynamicProxy.Proxy_....... because it is an abstract class"

I would appreciate any help in pointing me in the right direction to get this working, im guessing you either do AOP differently with remoting, or i need to implement the remoting in a different way

Thanks in advance

Bruno Baia
04-22-2006, 01:55 AM
Hi Michael,

this is a known issue, we are working on it.
The problem is Aop proxies does not support TransparentProxy as target, and the object returned by the SaoFactoryObject/CaoFactoryObject is a Transparent proxy.

Here is another topic talking about it :
http://forum.springframework.net/viewtopic.php?t=290

The issue in JIRA if you want to watch it :
http://opensource.atlassian.com/projects/spring/browse/SPRNET-293


-Bruno

michael.stephenson
04-23-2006, 12:18 AM
cheers for the quick response bruno