Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
ColdFusion 9.0.1.274733. Does ColdFusion has a hot fix "site" to download current hot fixes?
Copy link to clipboard
Copied
Here is the hot fix for ColdFusion 9.0.1. Since hot fixes are cumulative, you need only install the most recent(in this case, hot fix 2). However, I am sorry I cannot tell whether your build (9.0.1.274733) is older or newer than hot fix 2. I suspect older. You'll have to verify this elsewhere before making any changes.
Copy link to clipboard
Copied
I have the same error...on a multiserver setup with jrun...
C:\JRun4\servers\cfusion\SERVER-INF\temp\cfusion-war-tmp\redirect:\index.cfm\\WEB-INF\cftags\META-INF\taglib.cftld. The cause of this exception was: java.io.FileNotFoundException:
anybody knows if this bug is fixed? I have 9,0,1,274733
Copy link to clipboard
Copied
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);
}
}
}
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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/