Mey Mark, I've been working on some fixes related to factory-bean /
factory-method, but the code is not yet on cvs. You may be running
into a seperate issue, because currently beans that use factory-beans
can in a way short circuit the system into a recursive loop. It does
look by your setup that you are making a kind of odd circular
dependency, no? Can you do some different tests to see if autowire=no
is working properly for you? Ones without transfer perhaps?
Chris Scott
[EMAIL PROTECTED]
http://cdscott.blogspot.com/
http://www.coldspringframework.org/

On Apr 6, 2006, at 3:11 AM, Mark Mandel wrote:
I'm not sure if this is related - but it would seem to be.
I'm trying to get Transfer up and running under ColdSpring via it's
TransferFactory, and I'm using the latest version (including these
fixes below).
My services.xml declaration (the pertinent part) is:
<!-- Transfer -->
<bean id="transferFactory" class="transfer.TransferFactory"
singleton="true" autowire="no">
<constructor-arg name="datasourcePath">
<value>/config/datasource.xml</value>
</constructor-arg>
<constructor-arg name="configPath">
<value>/config/transfer.xml</value>
</constructor-arg>
<constructor-arg name="definitionPath">
<value>/config/definitions/</value>
</constructor-arg>
</bean>
<bean id="datasource" factory-bean="transferFactory"
factory-method="getDataSource" autowire="no"/>
<bean id="transfer" factory-bean="transferFactory"
factory-method="getTransfer" autowire="no"/>
The TransferFactory has an API of :
public Datasource getDatasource()
public Transfer getTransfer()
private void setDatasource(Datasource Datasource)
private void setTransfer(Transfer Transfer)
(The CFCDoc is at:
http://www.compoundtheory.com/transfer/documentation/cfcdoc/
contentc79e.html)
When any attempt is made to create any of these objects, either
throuhg CS directly, or through autowiring I end up with a 500 null
error (java.lang.StackOverflowError).
If I comment out the DataSource and Bean defintions, it will create
the TransferFactory with no problems.
If I rename the id of datasource to 'datasourceBean', and 'transfer'
to 'tranferBean', it also works fine.
I can only assume that the whole thing gets stuck in a nasty recursive
loop of doom, even though I've told it not to autowire.
I can work around it with the renaming, but it's not ideal.
Regards,
Mark
P.S. - Do these emails not get grouped into conversations on Gmail for
anyone else?
On 4/6/06, Sean Corfield <[EMAIL PROTECTED]> wrote:
On 4/5/06, Sean Corfield <[EMAIL PROTECTED]> wrote:
This passes my test case (after adding autowire="no" to the top-
level bean).
The default is byName?
BTW, it still autowires by both type and name :)
Given the following setters, it calls both of them:
<cffunction name="setThing" returntype="void"
access="public" output="false">
<cfargument name="thing" type="thing"
required="true" />
<cfset arrayAppend(variables.log,"setThing()
called") />
<cfset variables.thing = arguments.thing />
</cffunction>
<cffunction name="setFoo" returntype="void"
access="public" output="false">
<cfargument name="foo" type="test.cs.thing"
required="true" />
<cfset arrayAppend(variables.log,"setFoo()
called") />
<cfset variables.foo = arguments.foo />
</cffunction>
If you need the full test case, let me know (it runs automatically
via
CFUnit every time I modify any code in my 'test' directory tree :)
--
Sean A Corfield -- http://corfield.org/
Got frameworks?
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
--
E: [EMAIL PROTECTED]
W: www.compoundtheory.com
ICQ: 3094740