Search code examples
coldfusionlucee

Lucee- invalid component definition for custom tag


I'm working on a Lucee application that makes heavy use of custom tags.

My structure is as follows:

Calling app file - C:\lucee\tomcat\webapps\web-portal\web-champs\index.cfm

Location of file I'm calling - C:\lucee\tomcat\webapps\empportal\Champs\CFC\invoice.cfc

I've defined a custom tag in the Lucee admin with a name of empportal and resource of C:\lucee\tomcat\webapps\empportal\ (also tried without a trailing \). I restarted the server after adding the custom tag.

Error message

invalid component definition, can't find component [empportal.Champs.CFC.invoice] Stacktrace
The Error Occurred in C:\lucee\tomcat\webapps\web-portal\web-champs\dsp_outstandingInvoices.cfm: line 1
1: <cfinvoke component="empportal.Champs.CFC.invoice" method="getOutstandingItems" org_ID="#session.orgID#" returnvariable="getOutstandingItems" />

I also tried creating the component using new empportal.Champs.CFC.invoice() and same issue.


Solution

  • In Lucee you need to place files in the ROOT\ folder so tomcat can load them. In my case moving the folders to C:\lucee\tomcat\webapps\ROOT\ instead of C:\lucee\tomcat\webapps\ and restarting fixed the issue.