Hi Marc,

This is a shot in the dark, but do you need a prefix on your type?  In your
argument for setNewsletterGateway() function, you have:

<cfargument name="newsletterGateway" type="newsletterGateway"
required="true" />

But is that a valid path to the cfc?  Does it need to be
data.newsletterGateway, or something like that?

Cheers,
Bob


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Marc
Sent: March 22, 2007 2:03 PM
To: [email protected]
Subject: [Reactor for CF] Problem after switching to proper typing


Hi Everyone,

When I started building my app, I had been using returnType="any" on all my
functions, and type="any" for all my cfarguments.

I recently refactored my code, changing it so that I'm using proper typing.
So, of course, something had to break.  I am using CFMX6.1 with ColdSpring
and the latest Reactor code.

Here is my ColdSpring configuration (abbreviated to just the beans with the
problem):

        <bean id="newsletterService" class="model.NewsletterService">
                <property name="reactorFactory">
                        <ref bean="reactorFactory" />
                </property>
                <property name="newsletterGateway">
                        <ref bean="newsletterGateway" />
                </property>
                <property name="newsletterDAO">
                        <ref bean="newsletterDAO" />
                </property>
        </bean>


        <bean id="newsletterGateway" factory-bean="reactorFactory"
factory-method="createGateway">
                <constructor-arg name="objectAlias">
                        <value>newsletter</value>
                </constructor-arg>
        </bean>


        <bean id="newsletterDAO" factory-bean="reactorFactory"
factory-method="createDAO">
                <constructor-arg name="objectAlias">
                        <value>newsletter</value>
                </constructor-arg>
        </bean>


Here is my Reactor configuration:

        <reactor>
        
                <objects>
                                
                        <object name="newsletter" alias="newsletter" /> 
        

                </objects>
                
        </reactor>


Here is the coldspring-related functions in my NewsletterService.cfc:

        <cffunction name="getReactorFactory" access="public"
returnType="ReactorFactory" output="false" roles="" hint="">
                <cfreturn variables.instance.reactorFactory />
        </cffunction>


        <cffunction name="setReactorFactory" returntype="void"
access="public" output="false">
                <cfargument name="reactorFactory" type="any" required="true"
/>
                <cfset variables.instance.reactorFactory =
arguments.reactorFactory />
        </cffunction>


        <cffunction name="getNewsletterGateway"
returntype="newsletterGateway" access="public" output="false">
                <cfreturn variables.instance.newsletterGateway />
        </cffunction>


        <cffunction name="setNewsletterGateway" returntype="void"
access="public" output="false">
                <cfargument name="newsletterGateway"
type="newsletterGateway" required="true" />
                <cfset variables.instance.newsletterGateway =
arguments.newsletterGateway />
        </cffunction>


        <cffunction name="setNewsletterDAO" returntype="void"
access="public" output="false">
                <cfargument name="newsletterDAO" type="any" required="true"
/>
                <cfset variables.instance.newsletterDAO =
arguments.newsletterDAO />
        </cffunction>


And here is my beautiful new error:

The argument NEWSLETTERGATEWAY passed to function setNewsletterGateway() is
not of type newsletterGateway. If the component name is specified as a type
of this argument, the reason for this error might be that a definition file
for such component cannot be found or is not accessible.
 
The error occurred in {snipped}\NewsletterService.cfc: line 71


Line 71 is the setNewsletterGateway function.

The table in the database is named "Newsletter".

Can anyone tell me what I've done wrong?







-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- Reactor for ColdFusion Mailing List [email protected] Archives
at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --







-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to