It's a weird behavior,

Anyway, why using the DAO instead of the Record cfc? The record object when 
created has already a DAO inside of it (you can see it doing a dump of 
#myrecord._getDAO()#).

It's weird that CF hangs like that but for starting, when using remoting for 
flex, if you have trouble calling a destination make sure first that you can 
invoke that method in cfml.

Then you function says that it has  a return type of struct but you return 
nothing.
Set your config to development mode.
Delete previous generated files.
create a record instance just to force reactor to generate those files again.
Set your code in the yourRecordmssql.cfc file.
try to invoke it in a CFML page.
BTW, try to give your method some other name than "create".

João Fernandes
-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Ray Buechler
Sent: Fri 31-Mar-06 7:15 PM
To: [email protected]
Subject: Re: [Reactor For CF] Project DAO Files
 
João,

No I can't invoke the CFC on a CFML page. It actually makes Coldfusion
pretty much blow up. JRUN starts eating up memory  and the page times out
and I have to restart CF. I was able to pull this error message from the
exception log:

03/31 11:08:30 Error [jrpp-1] - Element TO.ANALYSTID is undefined in
ARGUMENTS.
The specific sequence of files included or processed is:
C:\Inetpub\wwwroot\admi
n\helpform\index.cfm, line: 12
03/31 11:08:36 Error [jrpp-2] - The method 'setShortName' could not be found
in
component
C:\Inetpub\wwwroot\admin\helpform\data\Record\AnalystRecordmssql.cfc.C
heck to ensure that the method is defined, and that it is spelled correctly.
The
 specific sequence of files included or processed is:
C:\Inetpub\wwwroot\admin\h
elpform\index.cfm, line: 12

I'm not even trying to pass any arguments at this point. Here is the custom
code I am trying to execute:

<cffunction name="create" access="remote" returntype="struct" output="false"
description="Creates an analyst">

        <!--- create an AnalystRecord --->
        <cfset AnalystRecord = Application.Reactor.createRecord("Analyst")
/>

        <!--- populate the new record --->
        <cfset AnalystRecord.setAnalystName("Ray Buechler") />
        <cfset AnalystRecord.setShortName("Ray") />
        <cfset AnalystRecord.setEmail("[EMAIL PROTECTED]") />

        <!--- save the record --->
        <cfset AnalystRecord.save() />
    </cffunction>

Here is the code on the CFML page:

<cfinvoke component="admin.helpform.data.Dao.AnalystDao" method="create" />

<cfset AnalystGateway = Application.Reactor.createGateway("Analyst") />

<br />
<cfdump var="#AnalystRecord#">

<!--- dump all of the analysts --->
<cfdump var="#AnalystGateway.getAll()#" />

If I take the code from the CFC and put it in a CML page it adds a record to
the database as expected.

Should I be putting this code in the Record CFC rather than the DAO CFC?

Thanks,

Ray

On 3/30/06, João Fernandes <[EMAIL PROTECTED]> wrote:
>
> Ray, Can you invoke your CFC in a CFML page without errors?
>
> I had a few time issues with the remote calls and I got also that error
> but the problem wasn't with the provided arguments but syntax error inside
> the CFC.
>
> João Fernandes
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] on behalf of Ray Buechler
> Sent: Thu 30-Mar-06 7:19 PM
> To: [email protected]
> Subject: Re: [Reactor For CF] Project DAO Files
>
> Okay.....looks like I have fixed the problem. Had to delete both the
> project
> files and the data folder files.
>
> I'm still having an issue however but this I think is related to my code.
>
> I'm using the Real Estate Sample Application from the fine folks at
> asfusion.com as the model for what I'm trying to do so this involves flash
> forms and flash remoting.
>
> My actionscript code looks like this:
>
> public function submitEdit():Void {
>     var editArguments:Object = {};
>
>     <!--- simple text inputs --->
>     editArguments.analystname = analystname.text;
>     editArguments.shortName = shortName.text;
>     editArguments.email = email.text;
>
>     <!--- only make call if all required fields are supplied --->
>     if( mx.validators.Validator.isStructureValid(this, 'HelpFormAdmin') ){
>         <!--- show clock cursor --->
>         mx.managers.CursorManager.setBusyCursor();
>
>         if (HelpFormAdmin.myGlobalObjects.isEditMode) {
>             <!--- call service --->
>             HelpFormAdmin.myGlobalObjects.AnalystDAO.update(
> editArguments.analystname, editArguments.shortName,  editArguments.email);
>         }
>         else {
>             <!--- call service --->
>             HelpFormAdmin.myGlobalObjects.AnalystDAO.create(
> editArguments.analystname, editArguments.shortName,  editArguments.email);
>         }
>     }
> }
>
> What I've done is stick the following code in the AnalystDAO cfc in my
> data
> folder:
>
>     <cffunction name="create" access="remote" returntype="struct"
> output="false" description="Creates an analyst">
>         <cfargument name="analystName" required="true" type="string"
> hint="Analyst Name"/>
>         <cfargument name="shortName" required="true" type="string"
> hint="Short Name" />
>         <cfargument name="email" required="true" type="string"
> hint="Email"
> />
>
>                 <!--- create an analystRecord --->
>         <cfset analystRecord = Application.Reactor.createRecord("Analyst")
> />
>
>
>         <!--- populate the Analyst --->
>         <cfset analystRecord.setAnalystName(arguments.analystName) />
>         <cfset analystRecord.setShortName(arguments.shortName) />
>         <cfset analystRecord.email(arguments.email) />
>
>         <!--- Save the Analyst --->
>         <cfset analystRecord.save() />
>
>     </cffunction>
>
> However I get the following error when trying to create a new record:
>
> Error: CF Adaptor Service: Service admin.helpform.data.dao.AnalystDAO does
> not have a method "create" that matches the name and parameters provided.
>
> Am I trying to do something that is not possible to do with reactor or is
> my
> code all wrong?
>
> Thanks,
>
> Ray
>
>
> On 3/30/06, Ray Buechler <[EMAIL PROTECTED]> wrote:
> >
> > João,
> >
> > Thanks....the <project> property was missing. Now I get the following
> > error though:
> >
> > The system has attempted to use an undefined value, which usually
> > indicates a programming error, either in your code or some system code.
> >
> > Null Pointers are another name for undefined values.
> > If I go back into Reactor.xml and remove the project property my code
> will
> > run.
> >
> > Thanks,
> >
> > Ray
> >
> > On 3/30/06, João Fernandes <[EMAIL PROTECTED]> wrote:
> > >
> > >  It seems that you don't have your <project> property set in your
> config
> > > file.
> > >
> > > Define it and try again.
> > >
> > >
> > >
> > > *João Fernandes**
> > > **Dep. Informática - Área de Desenvolvimento**
> > > **Cofina** media
> > >
> > > **Avenida João Crisóstomo, Nº 72 . 1069-043 Lisboa PORTUGAL**
> > > **Tel (+351) 213 185 200 . Fax (+351) 213 540 370**
> > > ** [EMAIL PROTECTED] <[EMAIL PROTECTED]>**
> > >
> > >
> > >  ------------------------------
> > >
> > > *From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> *On
> > > Behalf Of *Ray Buechler
> > > *Sent:* quinta-feira, 30 de Março de 2006 16:54
> > > *To:* [email protected]
> > > *Subject:* [Reactor For CF] Project DAO Files
> > >
> > >
> > >
> > > This may be sort of a weird question but what determines if a DAO cfc
> is
> > > generated in the project directory?
> > >
> > > I'm trying to write some custom code in the custom DAO object and when
> I
> > > run the code I get an error message "Could not find the ColdFusion
> Component
> > > reactor.project..DAO.AnalystDAO"
> > >
> > > Sure enough there is no AnalystDAO CFC in the project\dao directory.
> > >
> > > I did delete my project files with the same result.
> > >
> > > Any suggestions would be appreciated greatly.
> > >
> > > Ray
> > >
> > >
> > >
> > >
> > >
> > >
> > > -- 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/
> > >
> >
> >
>
>
>
>
> -- 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/
>
>


 

-- 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/

<<winmail.dat>>

Reply via email to