Hey Ray,
 
I think the problem might be this: createObject's second argument is a relative path to the CFC, but the datatype of the CFC is actually the full path to the file...
 
Hence, createObject("component","components.IssueBean") works, but it returns an object of type "farcry.Public.www.lighthousepro.components.IssueBean" and as far as CF is concerned, that whole path is the type. The only time I have been able to getting away with just using the actual file name of the CFC is when the whole collection is in one folder (Peter and I were just discussing this the other night... CF recognizes "package" as all the stuff in a *single folder* not in a folder tree like I was thinking it should be).

The upshot of this being that unless IssueDAO and IssueBean are in the same folder, you're going to have to use the whole type in order to get it to work. I've even had problems with returntype="" attributes not recognizing the object when returning "this" if depending on who's instantiating it because if a package CFC is using it then InfoBean works fine, but if a CFC in another folder is instantiating it, the system *demands* the whole frigging path.
 
Something a bit confusing in your snippet though... you set iBean = an object, but then a little later set iBean to be the results of a DAO's create() call... did you mean to do it that way? Not sure how your code is working, could be that your create() method returns a bean, too. But unless you're returning a bean from your create() call you're changing the datatype of iBean.
 
I think you'll find it works fine if IssueDAO.create() takes "farcry.Public.www.lighthousepro.components.IssueBean" as the datatype. The IssueBean type will only work if IssueBean and IssueDAO are physically located in the same folder.
 
HTH,
Jared
 
On 4/28/05, Raymond Camden <[EMAIL PROTECTED]> wrote:
A user is reporting an error on one of my projects and it doesn't make
any kind of sense. The code in question does...

<cfset iBean = createObject("component","components.IssueBean")>
crap, crap, crap
<cfset iBean = application.IssueDAO.create(iBean)>

IssueDAO throws this error:

The argument IBEAN passed to function create() is not of type IssueBean.

Which doesn't make any kind of sense. I did a dump of iBean, and
getMetaData on iBean. It is definitely a component. The name is a bit
odd though:

farcry.Public.www.lighthousepro.components.IssueBean

Shouldn't the last entry on the item be all that matters?



--
---------------
-------------------------------------
Buy SQLSurveyor!
http://www.web-relevant.com/sqlsurveyor
Never make your developers open Enterprise Manager again. ----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

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

Reply via email to