Title: RE: Coldspring datasource
Thread: Coldspring datasource
Forum: Need Help?
Conference: ColdBox
User: demirkapi I have the default code from generator without changing any part of it.
I
tried to give manual name for dsn and still same.
I tried different version of
ColdSpring and still same.
Here are my configs:
articlesDAO
<code>
<cfcomponent displayname="articlesDAO" hint="table ID column = articleID">
<cffunction name="init" access="public" output="false" returntype="articlesDAO">
<cfargument name="dsn" type="string" required="true">
<cfset variables.dsn
= arguments.dsn>
<cfreturn this>
</cffunction>
...
</code>
ColdSpring Config
<code>
<!-- Articles References -->
<bean
id="articlesDAO" class="components.dao.articlesDAO" singleton="false">
<constructor-arg name="dsn">
<value>magazine</value>
</constructor-arg>
</bean>
<bean id="articlesGateway"
class="components.gateway.articlesGateway">
<constructor-arg name="dsn">
<value>magazine</value>
</constructor-arg>
</bean>
<bean
id="articlesService" class="components.services.articlesService"
singleton="true">
<constructor-arg name="articlesDAO" >
<ref
bean="articlesDAO"/>
</constructor-arg>
<constructor-arg
name="articlesGateway">
<ref bean="articlesGateway"/>
</constructor-arg>
</bean>
</code>
articlesService
<code>
<cfcomponent
name="articlesService" output="false" cache="true" cachetimeout="30">
<cffunction name="init" access="public" output="false"
returntype="articlesService">
<cfargument name="articlesDAO"
type="articlesDAO" required="true" />
<cfargument name="articlesGateway"
type="articlesGateway" required="true" />
<cfset variables.articlesDAO =
arguments.articlesDAO />
<cfset variables.articlesGateway =
arguments.articlesGateway />
<cfreturn this />
</cffunction>
...
</code>
articles event handler
<code>
<cffunction name="list"
access="public" returntype="void" output="false">
<cfargument name="event"
type="coldbox.system.beans.requestContext" required="yes">
<cfscript>
//Get references
var rc = event.getCollection();
var oService =
getPlugin("ioc").getBean("articlesService");
...
</code>
Error message:
Application Execution Exception
Error Type:
coldspring.beanCreationException : [N/A]
Error Messages: Bean creation
exception during init() of components.services.articlesService
The ARTICLESDAO
argument passed to the init function is not of type articlesDAO.:If the
component name is specified as a type of this argument, its possible that a
definition file for the component cannot be found or is not accessible.
TIA!
http://www.luismajano.com/forums/index.cfm?event=ehMessages.dspMessages&threadid=B9458AEC-FF65-CEF6-659832953E213F04