I’ve just checked out revision 175 and its not working for me at all.  I’m getting the following error.

 

The value returned from function init() is not of type reactor.data.abstractObjectDao.

 

If the component name is specified as a return type, 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 /var/www/html/reactor/core/objectFactory.cfc: line 102
Called from /var/www/html/reactor/core/objectFactory.cfc: line 29
Called from /var/www/html/reactor/reactorFactory.cfc: line 46
Called from /var/www/html/index2.cfm: line 2
Called from /var/www/html/Application.cfc: line 37

100 :          <cfargument name="name" hint="I am the name of the object to translate." required="yes" type="string" />
101 :          <cfset var Object = CreateObject("Component", "reactor.core.object").init(arguments.name, getConfig()) />
102 :          <cfset var ObjectDao = CreateObject("Component", "reactor.data.#getConfig().getType()#.ObjectDao").init(getConfig().getDsn(), getConfig().getUsername(), getConfig().getPassword()) />         
103 :          
104 :          <cfset ObjectDao.read(Object) />

The createobject function on line 102 creates a “reactor.data.mysql.ObjectDao” but the init function from the abstractObjectDao says it returns a “reactor.data.abstractObjectDao”.  If I bodge this by setting its returntype to “Any”, I’m seeing similar errors with other objects.  abstractRecord throws an error when calling super.configure() which trys to return an abstractObject…

 

I’m not sure if this is a problem that my flaky dev box is creating or if I’ve got a screwy version of the code from SVN.. ?

 

Essentially here is the problem by way of two example cfcs

 

base.cfc

<cfcomponent>

     <cffunction name="test" access="public" returntype="base">

           <cfreturn this>

     </cffunction>

</cfcomponent>

 

extend.cfc

<cfcomponent extends="base">

</cfcomponent>

 

test.cfm

<cfset foo = createobject("component", "extend").test()>

 

Cheers,

 

Chris Blackwell
Running CF7.0.1 & MySQL 5 on Linux

 

 

Reply via email to