David: Thanks
Sean: You're right. Added your comments, but the error stayed.

Error : Service threw an exception during method invocation: Element
EMPLOYEEGATEWAY is undefined in a Java object of type class
[Ljava.lang.String; referenced as

Fron the NetConnection Debugger it seems the employeeManager,
employeeGateway and employeeDAO are created when Application.cfm is
executed. However, as soon as I try to call the getAllEmployees method the
error mesaage appears again and it seems the employeegateway object does not
exist anymore.

Any suggestions?

New code:

Application.cfm

<cfapplication name="atlantis" clientmanagement="yes"
sessionmanagement="yes" setclientcookies="no" setdomaincookies="yes">

<cfscript>      
        APPLICATION.dataSource           = "AtlantisDatabase";
        APPLICATION.ApplicationName      = "Atlantis";
</cfscript>

<cfif not structKeyExists(application,"employeeManager")>
  <cflock name="#APPLICATION.ApplicationName#_employeeManager"
type="exclusive" timeout="10">
     <cfif not structKeyExists(application,"employeeManager")>
          <cfset employeeManager =
createObject("component","atlantis.model.employeemanager").init() />
     </cfif>
  </cflock>
</cfif>

employeemanager.cfc

<cfcomponent displayname="Employee Manager" hint="I am the facade for the
Atlantis application">

  <cffunction name="init" access="public"
returntype="atlantis.model.employeemanager" output="false"
displayname="Constructor" hint="I initialize the Employee Manager.">

    <cfset var dsn = "#APPLICATION.DataSource#" />
    <cfset VARIABLES.employeeGateway =
createObject("component","atlantis.model.employeegateway").init(dsn) />
    <cfset VARIABLES.employeeDAO =
createObject("component","atlantis.model.employeedao").init(dsn) />
        
        <cfreturn this />

  </cffunction>
  
  <cffunction name="getAllEmployees" access="remote" returntype="query"
output="false" displayname="Get All Employees" hint="I return a query
containing all employees.">
    <cfreturn VARIABLES.employeeGateway.getEmployees() />

  </cffunction>  
</cfcomponent> 


Vinny




-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Sean A Corfield
Sent: dinsdag 3 februari 2004 18:55
To: [EMAIL PROTECTED]
Subject: Re: [CFCDev] implementing Sean Corfields data access pattern
without mach-ii

On Feb 3, 2004, at 5:30 AM, Kairoh! wrote:
>           <cfset employeeManager =
> createObject("component","atlantis.model.employeemanager").init() />

But your init() function doesn't return anything...

>   <cffunction name="init" access="public" returntype="void" 
> output="false"
> displayname="Constructor">

You need to return the object: change returntype= to specify
atlantis.model.employeemanager and add <cfreturn this /> at the end of the
function.

Regards,
Sean

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool,
Corporation (www.mindtool.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to