• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Component (.cfc) issues

Guest
May 19, 2006 May 19, 2006

Copy link to clipboard

Copied

As I understand it, coldfusion will automatically search for a .cfc file. I am getting a nasty error and I dont understand why. Any help will be greatly appreciated. All that I am trying to do is combine all of my database functions down into one file, I thought that the best way to do this would be through the use of a CFC but my first attempt isn't working too well.


----ERROR-------

Entity has incorrect type for being called as a function.
The symbol you have provided AddNewCourse is not the name of a function.

The error occurred in D:\Inetpub\medsyntrix\Cora\DBPages\CourseFunctions\AddCourse\index.cfm: line 5

3 :
4 : <cfinvoke componet="coursefunctions" method="AddNewCourse" returnvariable="coursenumber">
5 : <cfinvokeargument name="Title" value="Test">
6 : <!--- <cfinvokeargument name="message" value="#form.message1#">
7 : <cfinvokeargument name="profession" value="#form.profession#">



--------------------------------------------------------------------------------

Resources:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.


Browser Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Remote Address 69.137.246.170
Referrer http://www.medsyntrix.com/Cora/DBPages/CourseFunctions/AddCourse/index.cfm?Type=Text
Date/Time 19-May-06 09:40 AM

Stack Trace (click to expand)
at cfindex2ecfm1557986779.runPage(D:\Inetpub\medsyntrix\Cora\DBPages\CourseFunctions\AddCourse\index.cfm:5)


coldfusion.runtime.CfJspPage$UninvocableEntityException: Entity has incorrect type for being called as a function.
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:1777)
at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:403)
at cfindex2ecfm1557986779.runPage(D:\Inetpub\medsyntrix\Cora\DBPages\CourseFunctions\AddCourse\index.cfm:5)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:209)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:51)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:69)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:115)
at coldfusion.CfmServlet.service(CfmServlet.java:107)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at com.seefusion.Filter.doFilter(Filter.java:40)
at com.seefusion.SeeFusion.doFilter(SeeFusion.java:1160)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)


TOPICS
Advanced techniques

Views

389

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 19, 2006 May 19, 2006

Copy link to clipboard

Copied

Cold Fusion will automatically look for the cfc. I'm not sure if this is in the cfml reference manual, but the Macromedia Developing Cold Fusion MX Applications book gives this search pattern

1. current directory.
2. directory specified on Cold Fusion Mappings Page of Administrator
3. web root
4. Custom Tag directory as specified on Administrator page.

We never did figure out number 2, so, for the most part, we go with 4.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 19, 2006 May 19, 2006

Copy link to clipboard

Copied

In calling page index.cfm, try in front of line 3 code like this:
<cfset coursefunctions = CreateObject("component", "yourApps.yourComponentsDirectory.coursefunctions")>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 19, 2006 May 19, 2006

Copy link to clipboard

Copied

Why not just tell it where to find the component? Just use dot notation to
specify the location.
Let's say you have your cfcs stored in a folder, off the root, called _cfcs.
The you could call it like so:

<cfinvoke componet="_cfcs.coursefunctions" method="AddNewCourse"
returnvariable="coursenumber">

Just remember that your "component" value will always be based off the site
root regardless of where the calling page is located in the site.


--
Bryan Ashcraft (remove brain to reply)
Web Application Developer
Wright Medical Technologies, Inc.
=============================
Macromedia Certified Dreamweaver Developer
Adobe Community Expert (DW) :: http://www.adobe.com/communities/experts/


"Dan Bracuk" <webforumsuser@macromedia.com> wrote in message
news:e4ku8r$k20$1@forums.macromedia.com...
> Cold Fusion will automatically look for the cfc. I'm not sure if this is
> in
> the cfml reference manual, but the Macromedia Developing Cold Fusion MX
> Applications book gives this search pattern
>
> 1. current directory.
> 2. directory specified on Cold Fusion Mappings Page of Administrator
> 3. web root
> 4. Custom Tag directory as specified on Administrator page.
>
> We never did figure out number 2, so, for the most part, we go with 4.
>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 19, 2006 May 19, 2006

Copy link to clipboard

Copied

quote:

Originally posted by: Newsgroup User
Why not just tell it where to find the component? Just use dot notation to
specify the location.

Because it's less work to set up a location in the administrator than it is to go looking for a location every time you want to use a cfc.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 19, 2006 May 19, 2006

Copy link to clipboard

Copied

Had a bone head moment. THe answer is telling the administrator where to find the tag.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 19, 2006 May 19, 2006

Copy link to clipboard

Copied

LATEST
> <cfinvoke componet="coursefunctions" method="AddNewCourse" returnvariable="coursenumber">

It's not the typo in your code is it?

--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation