Yes, this time I made sure I both updated from CVS and am not running
any custom ColdSpring code BEFORE I sent this. ; )
I've two service objects that both depend on each other. The
prototypical circular dependancy. Never had any problems until I
wrapped both services in my transaction management aspect, at which
time the dependancy only resolves one way (so imageservice get's a
valid recipientservice, but recipientservice gets a bogus
imageservice). Here's the XML:
<bean id="imageservice" class="coldspring.aop.framework.ProxyFactoryBean">
<property name="target">
<bean class="sorter.cfcs.imageservice">
<property name="recipientservice">
<ref bean="recipientservice" />
</property>
</bean>
</property>
<property name="interceptorNames">
<list>
<value>transactionAdvice</value>
</list>
</property>
</bean>
<bean id="recipientservice" class="coldspring.aop.framework.ProxyFactoryBean">
<property name="target">
<bean class="sorter.cfcs.recipientservice">
<property name="imageservice">
<ref bean="imageservice" />
</property>
</bean>
</property>
<property name="interceptorNames">
<list>
<value>transactionAdvice</value>
</list>
</property>
</bean>
The error that actually arises is when the recipientservice bean tries
to invoke a method on the imageservice. It can't find the method,
because it doesn't exist. Dumping the imageservice that got passed
yields a ProxyFactoryBean instance, not a proxy. Further, it's not
actualy the ProxyFactoryBean defined in the XML, it's an new,
uninitialized instance of ProxyFactoryBean, which seems doubly weird.
In this particular case (because of the nature of the aspect I'm
weaving) I only cared about calls to service methods that originated
outside the service layer (i.e. not from other services). So I just
made the target imageservice bean a top-level bean and referenced it
from recipientservice, thereby converting the double-proxied circular
dependancy to a simple circular dependancy with proxying on one end.
No issues with this configuration or a zero-proxy config.
cheers,
barneyb
--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/
Got Gmail? I have 100 invites.