In your Mach II listener you should not have an init method.
configure() is the method you should use to set a listener. In this
case you just need a setter method for the reactor factory instead of
making it an argument to configure() so that ColdSpring will
automatically inject the reactor factory into the listener.
<cfcomponent name="ServiceListener" extends="MachII.framework.Listener">
<cffunction name="configure" access="public" returntype="void"
hint="Configures this listener">
</cffunction>
<cffunction name="setReactorFactory" access="public"
returntype="void" hint="Inits this listener">
<cfargument name="Reactor" required="true"
type="reactor.reactorFactory" />
<cfscript>
variables.Reactor = arguments.Reactor;
</cfscript>
</cffunction>
<cffunction name="getAll" access="remote" returntype="query">
<cfreturn variables.Reactor.createGateway('Service').getAll() />
</cffunction>
</cfcomponent>
--Kurt
On 12/29/06, Kyle Hayes <[EMAIL PROTECTED]> wrote:
Good Afternoon,
I hope I am not posting something that has been posted a billion times, but
here we are. I am not sure why I am having these issues as I have implement
ColdSpring and Reactor in my projects together before. I am also using
Mach-ii as my OO framework.
I am getting the following error when attempting to getAll() from my
"Service" table in my database:
The argument REACTOR passed to function init() is not of type
reactor.reactorFactory
The error occurred in
D:\Websites\DigitalEyeon\mladamsins\webroot\model\ServiceListener.cfc:
line 5
ServiceListener.cfc:
<cfcomponent name="ServiceListener" extends="MachII.framework.Listener">
<cffunction name="configure" access="public" returntype="void"
hint="Configures this listener">
</cffunction>
<cffunction name="init" access="public" returntype="void" hint="Inits this
listener">
<cfargument name="Reactor" required="true" type="reactor.reactorFactory" />
<cfscript>
variables.Reactor = arguments.Reactor;
</cfscript>
</cffunction>
<cffunction name="getAll" access="remote" returntype="query">
<cfreturn variables.Reactor.createGateway('Service').getAll() />
</cffunction>
</cfcomponent>
Services.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans>
<bean id="reactor" class="reactor.reactorFactory">
<constructor-arg name="configuration">
<value>/config/reactor.xml</value>
</constructor-arg>
</bean>
<bean id="serviceListener" class="model.ServiceListener" />
<bean id="udf" class="model.UDF" singleton="true" />
</beans>
Mach-ii ColdSpring plugin config:
<plugin name="ColdspringPlugin"
type="coldspring.machii.ColdspringPlugin">
<parameters>
<parameter name="configFilePropertyName" value="servicesConfig" />
<parameter name="configFilePathIsRelative" value="true" />
<parameter name="resolveMachiiDependencies" value="true"
/>
</parameters>
</plugin>
Thanks,
Kyle
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
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/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --