Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Wierd ColdFusion erro : Error occurred while processing request.

New Here ,
Aug 12, 2009 Aug 12, 2009

Hi there ,

I am a graduate student and new to ColdFusion.I started working on this already developed project by someone couple of years ago , and the client wants some changes to be done.so i went ahead and did some small modifications to the appearance of the form(insertdata.cfm page) like adding some more options to a drop down menu , changing the label names and so on and am very sure this changes would not have effected the application in any way.And the place where the message says the error can be , i didnt even touch that part.Now after 4 days i start getting this weird error saying " Error Occurred While Processing Request
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."

And this happens randomly not everytime i access the website or different webpages.Here are the errors.

The error occurred in /export/web/virtual/web3_unt_edu/cps/webaccess/sites/Amarillo/index.cfm: line 8
5 :   SELECT UserName,Password FROM user_data WHERE UserName=
6 :   <cfqueryparam value="#FORM.UserName#" maxlength="8">
7 :     AND Password=
8 :   <cfqueryparam value="#FORM.Password#" maxlength="8">
9 :   </cfquery>
10 :   <cfif MM_rsUser.RecordCount NEQ 0>


I tried adding " cfsqltype="cf_sql_clob"  " in cfqueryparam also on my friends advice , but it doesnt work out.

2nd ERROR

The error occurred in /export/web/virtual/web3_unt_edu/cps/webaccess/sites/Amarillo/InsertData.cfm: line 13

11 :   <cflocation url="#MM_failureURL#" addtoken="no">
12 : </cfif>
13 : <cfquery name="rsDay" datasource="cps">
14 : SELECT days FROM days
15 : </cfquery>


3rd ERROR

The error occurred in /export/web/virtual/web3_unt_edu/cps/webaccess/sites/Amarillo/InsertData.cfm: line 27

25 : ORDER BY ethnicity ASC
26 : </cfquery>
27 : <cfquery name="rsHospitals" datasource="cps_amarillo">
28 : SELECT *
29 : FROM hospitals

Can anyone help me with this. I have to get the modifications done in 2 weeks.
Thank you
Craj

3.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 13, 2009 Aug 13, 2009

For the first error try using cfsqltype="cf_sql_varchar". For the

second and third errors there's no error message in your message so

unless you're a computer-mind-reader it's quite hard to understand

what the problem might be.

Mack

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 13, 2009 Aug 13, 2009

Hi mack,

            I appreciate you're help , but i already tried that cfsqltype="cf_sql_varchar" for my first error and it doesnt work . Coming to the 2nd and 3rd error its the same error message i am getting saying that " Error Occurred While Processing Request
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." and then it displays the same lines of code which i gave in my first post. Now i m trying to use the CFAdministrator's log file and debuggin tools to find it . Lets hope it works out. If u find anythng else abnormal pls let me know.

Thank you

Craj

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 14, 2009 Aug 14, 2009

Can you paste the full stack trace for those errors ? (I think you

need to enable Robust Exceptions - in the CF Admin Debugging

department - to see the stack trace )

Mack

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 16, 2009 Aug 16, 2009

Hi Mak

         I can get the stack trace for now , but here is my complete code , may be this ll give u complete idea .........

The index page where i am getting the first error

<cfif IsDefined("FORM.UserName")>
  <cfset MM_redirectLoginSuccess="menu.cfm">
  <cfset MM_redirectLoginFailed="../../fail.htm">
  <cfquery  name="MM_rsUser" datasource="cps_amarillo">
    SELECT UserName,Password FROM user_data WHERE UserName=
  <cfqueryparam value="#FORM.UserName#" maxlength="8">
    AND Password=
  <cfqueryparam value="#FORM.Password#" maxlength="8">
  </cfquery>
  <cfif MM_rsUser.RecordCount NEQ 0>
    <cftry>
      <cflock scope="Session" timeout="30" type="Exclusive">
        <cfset Session.MM_Username=FORM.UserName>
        <cfset Session.MM_UserAuthorization="">
      </cflock>
      <cfif IsDefined("URL.accessdenied") AND true>
        <cfset MM_redirectLoginSuccess=URL.accessdenied>
      </cfif>
      <cflocation url="#MM_redirectLoginSuccess#" addtoken="no">
      <cfcatch type="Lock">
        <!--- code for handling timeout of cflock --->
      </cfcatch>
    </cftry>
  </cfif>
  <cflocation url="#MM_redirectLoginFailed#" addtoken="no">
  <cfelse>
  <cfset MM_LoginAction=CGI.SCRIPT_NAME>
  <cfif CGI.QUERY_STRING NEQ "">
    <cfset MM_LoginAction=MM_LoginAction & "?" & XMLFormat(CGI.QUERY_STRING)>
  </cfif>
</cfif>
<cfinclude template="../../../Connections/cps_amarillo.cfm">
<cfif IsDefined("FORM." & "UserName")>
  <cfscript>
    MM_valUsername=Evaluate("FORM." & "UserName");
    MM_fldUserAuthorization="";
    MM_redirectLoginSuccess="menu.cfm";
    MM_redirectLoginFailed="../../fail.htm";
    MM_dataSource=MM_cps_amarillo_DSN;
    MM_queryFieldList = "UserName,Password";
    if (MM_fldUserAuthorization IS NOT "") MM_queryFieldList=MM_queryFieldList & "," & MM_fldUserAuthorization;
  </cfscript>
  <cfquery datasource=#MM_dataSource# name="MM_rsUser" username=#MM_cps_amarillo_USERNAME# password=#MM_cps_amarillo_PASSWORD#>
  SELECT #MM_queryFieldList# FROM user_data WHERE UserName='#Replace(MM_valUsername,"\'","
  ","ALL")#' AND Password='#FORM.Password#'
  </cfquery>
  <cfif MM_rsUser.RecordCount GREATER THAN 0>
    <cfscript>
      // username and password match - this is a valid user
      Session.MM_Username = MM_valUsername;
      if (MM_fldUserAuthorization IS NOT "") {
        Session.MM_UserAuthorization = MM_rsUser[MM_fldUserAuthorization][1];
      } else {
        Session.MM_UserAuthorization = "";
      }
      if (IsDefined("accessdenied") AND true) {
        MM_redirectLoginSuccess = Evaluate("accessdenied");
      }
    </cfscript>
    <cflocation url="#MM_redirectLoginSuccess#" addtoken="no">
  </cfif>
  <cflocation url="#MM_redirectLoginFailed#" addtoken="no">
  <cfelse>
  <cfscript>
    MM_LoginAction = CGI.SCRIPT_NAME;
    if (CGI.QUERY_STRING NEQ "") MM_LoginAction = MM_LoginAction & "?" & CGI.QUERY_STRING;
  </cfscript>
</cfif>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Amarillo Login Screen</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d)&&d.all) x=d.all; for (i=0;!x&&i<d.forms.length;i++) x=d.forms;
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>

<body>
<div id="Layer2" style="position:absolute; left:26px; top:112px; width:683px; height:56px; z-index:2">
  <div align="right"><font size="+6"><strong><font color="#999999" size="5" face="Verdana, Arial, Helvetica, sans-serif">Seniors
    / Volunteers for Childhood Immunization<br />
    </font></strong></font><font color="#999999" size="5"><strong><font size="4" face="Verdana, Arial, Helvetica, sans-serif">Web
    Access Database</font></strong></font></div>
</div>
<div id="instructions" style="position:absolute; left:160px; top:182px; width:259px; height:30px; z-index:3"><font color="#999999" size="5"><strong><font size="4" face="Verdana, Arial, Helvetica, sans-serif">Please
  enter your user name and password...</font></strong></font></div>
<div id="LayerLogin" style="position:absolute; left:427px; top:182px; width:310px; height:94px; z-index:4">
  <form ACTION="<cfoutput>#MM_loginAction#</cfoutput>" name="form1" id="form1" method="POST">
    <p><img src="../../../images/image14.gif" alt="" name="UserNameImg" width="150" height="21" border="0" id="UserNameImg" />
      <input name="UserName" type="text" id="UserName" size="15" maxlength="15" />
      <br />
      <img src="../../../images/image15.gif" alt="" name="PasswordImg" width="150" height="21" border="0" id="PasswordImg" />
      <input name="Password" type="password" id="Password" size="17" maxlength="15" />
    </p>
    <p align="right">
      <input name="Submit" type="submit" id="Submit" onclick="MM_validateForm('UserName','','R','Password','','R');return document.MM_returnValue" value="Log In!" />
    </p>
  </form>
</div>
</body>
</html>

I checked it again and again , but the code seems to work well on a local host ..... but not whn i upload it to server. Please let me know where i am goin wrong.

Thank you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 16, 2009 Aug 16, 2009
LATEST

1st error

It seems  there isn't a field called 'password' in the form. Verify this.

2nd and 3rd error

It seems the datasources, cps and cps_amarillo, aren't well defined in the Coldfusion Administrator. Verify this.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources