Skip to main content
September 15, 2010
Question

Strange Error about Undefined Values

  • September 15, 2010
  • 3 replies
  • 1981 views

Hi I just migrated my site over to a new hosting provider about 3 weeks ago. I never had this error pop up until after I moved, so not sure if its an actual coding error on my part or something else. Anyway, I have a CF site and a database with about 1700 records so far. On my home page I have a list of "sections" or categories for the products on my DB. For example, photo lighting, television bulbs, medical lamps, and general lighting are just some of the categories I have the products divided in. When I click on one of these categories, it of course performs a query that returns the results WHERE category = "photo"

So this pulls every records containing the condition "photo", but every so often This error comes up saying something about Null pointer, or Undefined Values.

Here is the error:

The web site you are accessing has experienced an unexpected error.
Please contact the website administrator.

The following information is meant for the website developer for debugging purposes. 

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. 

 
The error occurred in C:\inetpub\vhosts\teed-younger.com\httpdocs\photoLighting.cfm: line 1

1 : <cfquery name="rsPhoto" datasource="rlbulbs">
2 : SELECT      a.item,
3 :             a.price,

--------------------------------------------------------------------------------

Resources:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.


Browser   Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; HPDTDF)
Remote Address   74.124.178.176
Referrer   http://teed-younger.com/
Date/Time   15-Sep-10 08:02 AM

Stack Trace (click to expand) 
at cfphotoLighting2ecfm1611342530.runPage(C:\inetpub\vhosts\teed-younger.com\httpdocs\photoLighting.cfm:1)


java.lang.NullPointerException
at com.mysql.jdbc.Statement.setMaxRows(Statement.java:2178)
at coldfusion.server.j2ee.sql.JRunStatement.setMaxRows(JRunStatement.java:214)
at coldfusion.sql.Executive.executeQuery(Executive.java:1267)
at coldfusion.sql.Executive.executeQuery(Executive.java:1009)
at coldfusion.sql.Executive.executeQuery(Executive.java:940)
at coldfusion.sql.SqlImpl.execute(SqlImpl.java:325)
at coldfusion.tagext.sql.QueryTag.executeQuery(QueryTag.java:838)
at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:528)
at cfphotoLighting2ecfm1611342530.runPage(C:\inetpub\vhosts\teed-younger.com\httpdocs\photoLighting.cfm:1)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:483)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:288)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.CfmServlet.service(CfmServlet.java:198)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)


btw, it also gives this same error sometimes when I perform a search from my site as well. Whats strange is I can click the back button in my browser and do the same thing again and the error doesnt appear. Thanks for any help!

    This topic has been closed for replies.

    3 replies

    Inspiring
    September 16, 2010

    That's more code than I'm prepared to read but when I get that specific error, it's usually because I attempted to use results from a query that didn't return any rows.

    September 16, 2010

    Well again. I could see that error if it was thrown EVERY time the same page and same query was requested. Also, I wasn't asking for someone to read all the code, which one of the pages in question is only maybe 50 or so lines with a simple query and a dynamic table. lol

    I meant if someone else were to open some of the pages and see if the error happened for them.

    Anyway, if there was a query issue or coding issue, I think the error would happen every time.

    September 15, 2010

    Any ideas? I think its my hosting provider. Why would it throw up an error, then when I click back and click the same link, it works the second time?

    Inspiring
    September 15, 2010

    I don't see any obvious bugs in your code. Is there anything in the operating system or database logs that might point to a problem, such as connection issues with the database?

    September 15, 2010

    If you mean the logs on my remote server control panel, I dont see anything that stands out. What other logs could I look at?

    Inspiring
    September 15, 2010

    Can you post the entire CFQUERY?

    September 15, 2010

    Sure can. Its not just one query or page thats doing it though. The error I posted above was from a template named "photoLighting.cfm"

    This code below, which caused thesame error just now is from "search.cfm"

    Here is the whole template:

    <cfquery name="rsBulbs" datasource="rlbulbs">
    SELECT item
    FROM rlbbulbs
    ORDER BY item ASC
    </cfquery>
    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Replacement Light Bulb Advanced Search</title>
    <link href="rlb.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="wrapper">
      <cfinclude template="header.cfm">
      <div id="main">
        <div id="sidebar">
          <cfinclude template="sidebar.cfm">
        </div>
        <div id="content">
          <h2>Advanced Bulb Search</h2>
          <p>Please enter data in one or more of the
                    fields below and <br />
                    click the Search button. The more fields you can fill out, the more refined your search will be.</p>
          <form action="results.cfm" method="post">
            <table border="0" cellpadding="2" cellspacing="0">
              <tr>
                <th width="137" nowrap="nowrap">Item Number:</th>
                <td width="221"><input type="text" name="item" size="35" /></td>
                <td width="130" nowrap="nowrap">Ex. 75K19</td>
              </tr>
              <tr>
                <th>Brand Name:</th>
                <td><input type="text" name="brandName" size="35" /></td>
                <td nowrap="nowrap">Ex. Philips</td>
              </tr>
              <tr>
                <th>Base Type:</th>
                <td><input type="text" name="base" size="35" /></td>
                <td nowrap="nowrap"><a href="#"><img src="images/screwBase.gif" alt="Base Type" width="30" height="25" /></a></td>
              </tr>
              <tr>
                <th>Glass Type:</th>
                <td><input type="text" name="glass" size="35" /></td>
                <td><a href="#"><img src="images/classic.gif" width="30" height="35" alt="Glass Type" /></a></td>
              </tr>
              <tr>
                <th>Wattage:</th>
                <td><input type="text" name="wattage" size="35" /></td>
              </tr>
              <tr>
                <th>Voltage:</th>
                <td><input type="text" name="voltage" size="35" /></td>
              </tr>
              <tr>
                <td align="center" colspan="3"><input type="submit" value="Search" />
                  <input type="reset" value="Reset" name="reset" /></td>
              </tr>
            </table>
          </form>
        </div>
      </div>
      <cfinclude template="footer.cfm">
    </div>
    </body>
    </html>


    I dont know why that query is on this page. Doesn't seem to be needed. The other page does need the query, so here is the query for it:

    <cfquery name="rsPhoto" datasource="rlbulbs">
    SELECT      a.item,
                a.price,
                b.brandName,
                a.bulbDesc,            
       a.base,
       a.glass,
                a.oldPage,
                a.avgLife            
    FROM rlbbulbs a,rlbbrand b
    WHERE a.brandID = b.brandID
    AND a.catagory = "photo"
    </cfquery>
    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Replacement Light Bulbs : Photo & AV Lamps</title>
    <!-- TemplateEndEditable -->
    <link href="../rlb.css" rel="stylesheet" type="text/css" />
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    </head>
    <body>
    <div id="wrapper">
      <cfinclude template="../header.cfm">
      <div id="main">
        <div id="sidebar">
          <cfinclude template="../sidebar.cfm">
        </div>
        <!-- TemplateBeginEditable name="mainContent" -->
        <div id="content">
          <!--- Start Content --->
          <h2>Photo & AV Lamps</h2>
          <p><strong>Total Bulbs Found:</strong><cfoutput>#rsPhoto.RecordCount#</cfoutput></p>
          <div style="overflow:auto; height:500px; width: 95%;">
          <table border="1" cellpadding="2" cellspacing="2">
            <tr>
              <th>Item #</th>
              <th>Price</th>
              <th>Brand Name</th>
              <th>Description</th>
              <th>Base</th>
              <th>Glass</th>
              <th>Average Life</th>
             
            </tr>
            <cfoutput query="rsPhoto">
              <tr>
                <td><a href="#rsPhoto.oldPage#">#rsPhoto.item#</a></td>
                <td>#dollarFormat(rsPhoto.price)#</td>
                <td>#rsPhoto.brandName#</td>
                <td>#rsPhoto.bulbDesc#</td>
                <td>#rsPhoto.base#</td>
                <td>#rsPhoto.glass#</td>
                <td>#rsPhoto.avgLife#</td>
              </tr>
            </cfoutput>
          </table>
          <!--- End Content --->
        </div>
        <!-- TemplateEndEditable --></div>
      <cfinclude template="../footer.cfm">
    </div>
    </body>
    </html>

    September 15, 2010

    God this is the buggiest forum! I poost codes and quotes and they show up until I click post! Then I click edit and they are there! CLick post and they're gone! *sigh* here goes again!

    search.cfm code:

    <cfquery name="rsBulbs" datasource="rlbulbs">
    SELECT item
    FROM rlbbulbs
    ORDER BY item ASC
    </cfquery>
    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Replacement Light Bulb Advanced Search</title>
    <link href="rlb.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="wrapper">
      <cfinclude template="header.cfm">
      <div id="main">
        <div id="sidebar">
          <cfinclude template="sidebar.cfm">
        </div>
        <div id="content">
          <h2>Advanced Bulb Search</h2>
          <p>Please enter data in one or more of the
                    fields below and <br />
                    click the Search button. The more fields you can fill out, the more refined your search will be.</p>
          <form action="results.cfm" method="post">
            <table border="0" cellpadding="2" cellspacing="0">
              <tr>
                <th width="137" nowrap="nowrap">Item Number:</th>
                <td width="221"><input type="text" name="item" size="35" /></td>
                <td width="130" nowrap="nowrap">Ex. 75K19</td>
              </tr>
              <tr>
                <th>Brand Name:</th>
                <td><input type="text" name="brandName" size="35" /></td>
                <td nowrap="nowrap">Ex. Philips</td>
              </tr>
              <tr>
                <th>Base Type:</th>
                <td><input type="text" name="base" size="35" /></td>
                <td nowrap="nowrap"><a href="#"><img src="images/screwBase.gif" alt="Base Type" width="30" height="25" /></a></td>
              </tr>
              <tr>
                <th>Glass Type:</th>
                <td><input type="text" name="glass" size="35" /></td>
                <td><a href="#"><img src="images/classic.gif" width="30" height="35" alt="Glass Type" /></a></td>
              </tr>
              <tr>
                <th>Wattage:</th>
                <td><input type="text" name="wattage" size="35" /></td>
              </tr>
              <tr>
                <th>Voltage:</th>
                <td><input type="text" name="voltage" size="35" /></td>
              </tr>
              <tr>
                <td align="center" colspan="3"><input type="submit" value="Search" />
                  <input type="reset" value="Reset" name="reset" /></td>
              </tr>
            </table>
          </form>
        </div>
      </div>
      <cfinclude template="footer.cfm">
    </div>
    </body>
    </html>


    here is photoLighting.cfm code:

    <cfquery name="rsPhoto" datasource="rlbulbs">
    SELECT      a.item,
                a.price,
                b.brandName,
                a.bulbDesc,            
       a.base,
       a.glass,
                a.oldPage,
                a.avgLife            
    FROM rlbbulbs a,rlbbrand b
    WHERE a.brandID = b.brandID
    AND a.catagory = "photo"
    </cfquery>
    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Replacement Light Bulbs : Photo & AV Lamps</title>
    <!-- TemplateEndEditable -->
    <link href="../rlb.css" rel="stylesheet" type="text/css" />
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    </head>
    <body>
    <div id="wrapper">
      <cfinclude template="../header.cfm">
      <div id="main">
        <div id="sidebar">
          <cfinclude template="../sidebar.cfm">
        </div>
        <!-- TemplateBeginEditable name="mainContent" -->
        <div id="content">
          <!--- Start Content --->
          <h2>Photo & AV Lamps</h2>
          <p><strong>Total Bulbs Found:</strong><cfoutput>#rsPhoto.RecordCount#</cfoutput></p>
          <div style="overflow:auto; height:500px; width: 95%;">
          <table border="1" cellpadding="2" cellspacing="2">
            <tr>
              <th>Item #</th>
              <th>Price</th>
              <th>Brand Name</th>
              <th>Description</th>
              <th>Base</th>
              <th>Glass</th>
              <th>Average Life</th>
             
            </tr>
            <cfoutput query="rsPhoto">
              <tr>
                <td><a href="#rsPhoto.oldPage#">#rsPhoto.item#</a></td>
                <td>#dollarFormat(rsPhoto.price)#</td>
                <td>#rsPhoto.brandName#</td>
                <td>#rsPhoto.bulbDesc#</td>
                <td>#rsPhoto.base#</td>
                <td>#rsPhoto.glass#</td>
                <td>#rsPhoto.avgLife#</td>
              </tr>
            </cfoutput>
          </table>
          <!--- End Content --->
        </div>
        <!-- TemplateEndEditable --></div>
      <cfinclude template="../footer.cfm">
    </div>
    </body>
    </html>