Inconsistent 'Cannot find CFML template for custom tag' error - coldfusion

I have a CF9 site set up locally on OSX Snow Leopard, and it's started to behave very strangely - probably about 1 out of every 5 times I load any page in the site, it will throw a 'Cannot find CFML template for custom tag' error. I just refresh the page and then everything works fine. It can happen on any page, but it never happens consistently with any one page. Furthermore, this doesn't happen at all on the live server when the code is checked in through SVN, so I figure it has to be some kind of configuration problem on my local instance. I can still do my work, but it's pretty annoying having to refresh pages ALL the time. Has anyone run into similar difficulties?

Try using <cfmodule template="pathTo/yourTag.cfm"> rather than <cf_yourtag>, so you can specify the exact location of the template (in case the server is getting confused as to where it resides).
FYI, this is based on a tip from Raymond Camden's blog post: http://www.raymondcamden.com/index.cfm/2006/8/17/ColdFusion-Custom-Tag-Tips

Chris, odd that I should run into your question now, as this just started happening to me last night. I have all of my CF errors being emailed to me, and I am seeing that similar problems are happening across multiple sites that all run the same software, some of which haven't been touched in a long time. That got me thinking, it's probably a corrupt compiled template in the CF cache. You can recompile the template by making a slight change to it, say add an extra line or a comment or something, then access the site again. Or, purge the whole cache and let CF rebuild everything, which is likely what I'll do since who knows what else might be affected.
Clearing the Cache in Coldfusion Production server

Related

CF Admin showing the root website

My CFIDE just went crazy this morning and I can't locate the what is causing this. When I log in from example.com/cfide/administrator/index.cfm some of the tabs on the left work fine and some are showing the index page of example.com like in an iframe... I restarted the app server but the issue is still there. Any recommendations on how to debug this thing?
So for posterity here is what we found.
There are two possibilities of exploits that could be affecting you:
the bitcoin exploit (miner.d)
the ckeditor file upload exploit (this is the h.cfm file)
There are others but these are common and known. Both tap underlying java to unfold work that either calls something more sinister, delivers server meta data or unrolls a scheduled task to fireoff worker bees to consume resources doing something the admin is unaware of.
So as we discovered we have a varietal of this h.cfm called fusebox.cfm (obfuscated with bonus encrypted CF5 garble). If you can open the file you will see that h.cfm file and open it you will see UGLY and Obfuscated code but not very sophisticated. A lot can be revealed by a coder's code and if you deconstruct and format this particular code you will discern that the developer is not native to CF, and jumps from script style to CMFL style (in caps no-less).
(here is the Stack Overflow link with the raw code (be careful))
It is also named: i.cfm, h9.cfm, r.cfm, adss.cfm or fusebox.cfm here is the black hat page that give you a ton of info. I'm viewing the cached site because I don't trust the blackhat sites. (because one loaded something on my system that raised an antivirus alert).
The file may be unreadable so here is a link to a site that describes some github sourcecode that can decrypt it for you. That is Coldfusion 5 crap that still floats around now and again. (I'm pretty sure it will look similar to that code in the SO link I pasted above).
Post mortum: One more coldfusion serve saved from villainy. Remember, it never hurts to run through your systems and see if anything can be found like this. It also never hurts to make things a little more difficult for would be server exploiters ;)

How to solve cache? issue when using jasmine standalone

When I go to SpecRunner.html in my browser, the unit tests run fine. The issue I am having is if I change one of the tests, or the code that it tests and refresh the page, it doesn't load the new tests or change at all. I thought that this would be a cache issue, but I have the chrome dev tools disable cache selected.
What am I doing wrong?
Thanks
EDIT: tried restarting my computer, nothing. Clearing cache, nothing. I don't understand why this would be happening.
EDIT2: tried force reload, nothing... changed the file name and reference and still loaded the old code...
This might not answer your specific problem, as there are a million reasons this could happen.
For me, it was because I had deleted some files and then re-added them as a git submodule. After doing this, ls was showing me the OLD files, and I didn't realize that I had to go up a directory and then back in to interact with the new files I had just pulled down.
Old question but I ended up here when looking for an answer, so here's my solution in case it helps anyone - I was having a similar problem with jasmine-rails, removing jasmine-specs.js from public/assets did it for me. I'm using the jasmine-rails gem from https://github.com/searls/jasmine-rails.

Coldfusion 10: Method is not found in component

Since we installed ColdFusion 10, we have received several error messages such as
"Method ifspDueDt is not found in component [fullpath]\incTabCnt.cfc."
We are trying to call a method named ifspDueDt. It is called in one place in our entire application and when it's called, it's called from ifsp.cfc. We use engine.js for our AJAX, so the call looks like this:
http('POST','../Components/ifsp.cfc?method=ifspDueDt', IFSPDueDtResp, param);
We are completely baffled by the fact that for some reason and only on some occasions (certainly not all the time), ColdFusion is looking for ifspDueDt in incTabCnt.cfc instead of ifsp.cfc. There is no other place where this method is called. What could be causing this?
We probably get 1-2 of these errors per week, whereas we have several hundred users accessing the system.
It looks like ColdFusion 10 update 3 solves this problem, at least for the code I'm working on. Having said that, I don't yet recommend upgrading, due to a series of other issues with update 3. See the comments on the CF blog post announcing update 3. Note that at least two other people have posted in that comment thread that they are still experiencing the "wrong page displayed" problem, which seems like it's closely related to the "wrong component" problem we're discussing in this question.
We were fortunate that we don't use CF scheduled tasks, and we did not hit any of the startup errors or other problems in our testing environment, although one of my teammates did hit a number of problems which corrupted his dev environment.
I really hope Adobe moves quickly with update 4 (or a replacement for update 3).

Weird issue with cftextarea/cfwindow

A while ago, I worked on an application where a manager can approve/deny xxx applications. When some body selects an action from a drop down, it opens a cfwindow and loads cftextarea richtext="yes" in there, so that they could enter reasons for approval/denial.
Now the culprit is that in production, the fckEditor has a ton of funky chars in IE8. Same thing won't happen in FireFox. Also, the IE8 does not show the same stuff in dev.
I have looked at the scripts in /cf_admin/CFIDE/scripts/ajax/FCKeditor, they are all the same.
Since this wasn't an issue before, I am not sure where to look at. Something got updated on the server which probably causes this problem. Does anybody know what could be the problem?
It turns out the vp put the header X-UA-Compatible: IE=IE7 in IIS to force IE8 emulate IE7. When I made them change this to X-UA-Compatible: IE=EmulateIE7, everything started to work perfectly again. For more details see Introducing IE=EmulateIE7.
Hope it helps others. Thanks.

ColdFusion 9 Upgrade: Invalid branch target position offset

I'm working on upgrading an app from MX7 to 9 and testing it on my Mac's Dev server. I have a page with a large cfswitch--20 or so different cases, but none more than about 10-12 lines long. In CF9 only, whenever one of these cases does a cfinclude (which is almost all of them), I get an error along the lines of:
org.apache.bcel.generic.ClassGenException: Invalid branch target position offset for jsr[168](3):-1: -1: astore[58](2) 27 at
cfindex2ecfm581352809._factor4(/Users/dlaughland/Workspace/abcapp/surveymanager /surveys/survey/index.cfm:34) at
cfindex2ecfm581352809._factor28(/Users/dlaughland/Workspace/abcapp/surveymanager/surveys/survey/index.cfm:33) at
cfindex2ecfm581352809.runPage(/Users/dlaughland/Workspace/abcapp/surveymanager/surveys/survey/index.cfm:1) at
cfApplication2ecfc1705547767$funcONREQUEST.runFunction(/Users/dlaughland/Worksp ace/abcapp/Application.cfc:215)
I have googled extensively, and the best explanation I can find is a JDK error that was supposedly fixed in MX7! What is causing this? How do I fix it? This isn't the only page with a large cfswitch so I really don't want to re-write everything into cfif structures.
You can file a bug, but here are some steps that might help you work around the issue.
Try updating your JRE version, you can get the latest and greatest here. You can then ask CF to use that JRE via your CF Admin > Server Settings > Java and JVM. Further instructions here.
Try using a servlet container, for example use Tomcat instead of the bundled JRun. Here are some instructions.
Can I ask if you are going to use this in production on a Mac? If not, try running your code on a OS that will mirror your live site. The bug (if it is a bug) may not be in that version of CF.
Hope something there helps.
If you upgraded from CF7 to CF9 with the code already on the server, try deleting all of the classes from WEB-INF/cfclasses and restarting CF.