August 28, 2008
For ColdFusion hosting try HostMySite.com. |
Home /
Groups /
ColdFusion Talk (CF-Talk)
undefined value error weird
Ok, every once in a while, usually the first time I load my website every few hours, I am getting this error:Jessica Kennedy 07/04/08 12:31 A > 4 : <cfset finduser = ListToArray(cgi.server_name, ".")>Will Tomlinson 07/04/08 04:38 A Duly noted on queryparams! Problem still is that I can't replicate the problem... if I cfdump the vars when I go back to refresh the page the error goes away, and I can't figure out how to get it back.Jessica Kennedy 07/04/08 10:46 A > Duly noted on queryparams! Problem still is that I can't replicateWill Tomlinson 07/04/08 11:41 A That might work assuming the error is in fact in the empty array... i needed a full array for a while, but it isn't necessary anymore, so that'll be something I will change.Jessica Kennedy 07/05/08 12:19 A Maybe somethin like this would work?Will Tomlinson 07/04/08 11:53 A ok... hopefully no one else will encounter this error, but I found a forum that is discussing this issue... the problem isn't in the code but in the way coldfusion 8 is connecting to mysql 5 db... here is the link for those interested:Jessica Kennedy 07/07/08 12:40 A > ok... hopefully no one else will encounter this error, but I found aWill Tomlinson 07/07/08 10:15 P Ok, every once in a while, usually the first time I load my website every few hours, I am getting this error: " The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code. Null Pointers are another name for undefined values." upon refreshing the page, the error goes away completely (even clearing all private data will not bring the error back), which is making it very difficult to pinpoint exactly what the problem is... here is the code I have that is throwing the error, according to Coldfusion it throws on line 8: 4 : <cfset finduser = ListToArray(cgi.server_name, ".")> 5 : <cfquery name="rsfinduser" datasource="#application.db#"> 6 : SELECT dealerID, username, first_name, last_name 7 : FROM tblsozo_dealers 8 : WHERE username = '#finduser[1]#' 9 : </cfquery> The only thing I could figure is that finduser[1] was undefined, so I added a clause to give finduser[1] a name in the highly unlikely event that it was undefined, to no avail. Also, the error is only throwing on my web server, not on the testing server, don't know if that is important or not. Any help would be greatly appreciated! Thanks! > 4 : <cfset finduser = ListToArray(cgi.server_name, ".")> ----- Excess quoted text cut - see Original Post for more ----- 1. Dump cgi scope to see what's in your server_name variable. 2. More of a heads up - the list is about to jump you for not using <cfqueryparam> in your WHERE clause. :) Whenever in doubt, dump! hth, Will Duly noted on queryparams! Problem still is that I can't replicate the problem... if I cfdump the vars when I go back to refresh the page the error goes away, and I can't figure out how to get it back. I've considered the issue being in the application variable not declaring first. this code is in a stored template called to the page... could that be it, and if so,,, how can I fix it?? ----- Excess quoted text cut - see Original Post for more ----- > Duly noted on queryparams! Problem still is that I can't replicate > the problem... if I cfdump the vars when I go back to refresh the page > the error goes away, and I can't figure out how to get it back. Are you just trying to grab the server name? Looks like you're jumping thru an extra hoop converting it to an array like that. Just use this: listFirst(cgi.server_name, ".") Doubt that solves your problem. Just something I noticed. Will That might work assuming the error is in fact in the empty array... i needed a full array for a while, but it isn't necessary anymore, so that'll be something I will change. I think the error might be in the application, after all... I got the same error randomly in a secure section of the site where there was nothing else to be blank. at least now i have a pretty good idea of the cause, just not the solution... yet... ----- Excess quoted text cut - see Original Post for more ----- Maybe somethin like this would work? <cfif listLen(cgi.server_name, ".")> <cfset theServer = listFirst(cgi.server_name, ".")> <cfelse> <cfset theServer = "Whatever"> </cfif> <cfquery>.... WHERE username = <cfqueryparam value="#theServer#"> </cfquery> ok... hopefully no one else will encounter this error, but I found a forum that is discussing this issue... the problem isn't in the code but in the way coldfusion 8 is connecting to mysql 5 db... here is the link for those interested: http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=3&threadid=1303546&highlight_key=y&keyword1=Maintain%20connections#4723205 > ok... hopefully no one else will encounter this error, but I found a > forum that is discussing this issue... the problem isn't in the code > but in the way coldfusion 8 is connecting to mysql 5 db... here is the > link for those interested: > > http://www.adobe.com/cfusion/webforums/forum/messageview. cfm?forumid=1&catid=3&th> readid=1303546&highlight_key=y&keyword1=Maintain%20connections#4723205 Well that sucks! Yanno, I've had problems with CF8 and MySQL in the past. It's unrelated, but they emailed me an unreleased hotfix that fixed me right up.
|
Mailing Lists
|
Latest Fusion Authority Articles
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||