Skip to main content
March 22, 2012
Question

Cfthread Error, Cannot Find File "taglib.cftId"

  • March 22, 2012
  • 3 replies
  • 4421 views

I am using several threads within a ColdFusion request to create PDF files.  When I run the code on my ColdFusion developers edition environment, it works just fine.  However, when I attempt to run it on another environment, I always get the same error:

An error occurred when performing a file operation read on file MYAPPDIRECTORY\WebRoot\WEB-INF\cftags\META-INF\taglib.cftld. The cause of this exception was: java.io.FileNotFoundException: MYAPPDIRECTORY\WebRoot\WEB-INF\cftags\META-INF\taglib.cftld (The system cannot find the path specified).

The issue is of course that ColdFusion is looking in the incorrect directory.  I researched the issue and found the mention of a ColdFusion bug, but I am curious if anybody else has run into a similar issue and if they found a workaround/solution.

This topic has been closed for replies.

3 replies

Participant
December 11, 2012

This bug does not seem to be fixed, but Zack1590's workaround will solve the problem. 

The issue is that getSupportedTagAttributes cannot find the correct path for /WEB-INF as getRealPath does not work inside the cfthread. Luckily the results of getSupportedTagAttributes are cached in server memory. This means that if the tags are called from outside a cfthread first they will then work fine inside the cfthread. By making sure all the custom tags are called before entering the cfthread Zack1590 is able to avoid this error.

More info: http://www.danielgaspar.com/blog/2012/12/taglib-cftld-the-system-cannot-find-the-path-specified/

Participant
April 30, 2012

Right before I run threads, I create the following component and run the one function on it.  It's a nice little work around.

component extends="com.adobe.coldfusion.base"

{

    public function cacheScriptObjects()

    {

        local.tags = ["CFFTP","CFHTTP","CFMAIL","CFPDF","CFQUERY","CFPOP","CFIMAP","CFFEED","CFLDAP"];

        for(local.tag in local.tags)

        {

            getSupportedTagAttributes(local.tag);

        }

    }

}

June 3, 2013

Zach's trick worked for me in CF 9.0.1 Developer Ed.

There is no bug id 83835 in Adobe's new bugbase (https://bugbase.adobe.com/).  Did this get fixed yet?  How about in CF 10?

Inspiring
March 27, 2014

The bug ref in the new bugbase is https://bugbase.adobe.com/index.cfm?event=bug&id=3041891

And, no, Adobe have decided they have better things to do than fix this.

--

Adam

BKBK
Community Expert
Community Expert
March 23, 2012

In my opinion, taglib.cftld is a sysytem file. I can imagine why ColdFusion complains. Shouldn't the path be {CF_INSTALLATION_DIR}\wwwroot\WEB-INF\cftags\META-INF\taglib.cftld instead of MYAPPDIRECTORY\WebRoot\WEB-INF\cftags\META-INF\taglib.cftld?

March 23, 2012

Yes, it should, but it "changes" within the thread.  See http://www.elliottsprehn.com/cfbugs/bugs/83835#votes.

If you run

getPageContext().getServletContext().getRealPath("/WEB-INF")

from outside a ColdFusion <cfthread> and then run it within the <cfthread>, the returned filepath changes.

BKBK
Community Expert
Community Expert
March 24, 2012

What's your ColdFusion version/build? Since the taglib.cftld issue has been registered as a bug. I would my advise you to install the appropriate hot fix.