This is more than likely a component pathing issue (as the error
suggests). You said your controllers are in the controller directory
of the app root, then they should be referenced as
appfoldername.controller.wizardcontroller - both in the coldspring.xml
and in the type attribute of your cfargument.
It's weird that ColdSpring can create the components but they can't
resolve each other's types - but I've seen MX do stranger things with
CFC paths/types.
-Dave
On 7/14/06, Doug Boude <[EMAIL PROTECTED]> wrote:
This is my first attempt to do any "manual" dependency injection using bean
definitions within coldspring.xml, and I just can't get it to work.
The scenario:
Using MGU, latest code. I have two controllers - ProductController and
WizardController, both residing in the "controllers" directory off of the
app root. I want to inject, as a constructor argument, ProductController
into WizardController.
coldspring.xml snippet
<bean id="productcontroller" class="controller.productcontroller" />
<bean id="wizcontroller" class="controller.wizardcontroller ">
<constructor-arg name="PController">
<ref bean="productcontroller" />
</constructor-arg>
</bean>
Init method of WizardController:
<CFFUNCTION name="init" returntype="controller.wizardcontroller"
output="false" access="public">
<cfargument name="PController" type="controller.productcontroller "
required="true" hint="Dependency product controller"/>
<cfset variables.prodcontroller = arguments.PController/>
<CFRETURN this />
</CFFUNCTION>
The Symptoms:
I receive the error whenever the wizardcontroller is instantiated:
The argument PCONTROLLER passed to function init() is not of type
controller.productcontroller.
On an interesting side note, if i change the type argument to "Any", i get
no error, but the object that gets injected into the PController variable is
ModelGlue.unity.framework.ModelGlue
How's THAT for strange!
Can anybody see what I'm doing wrong?