views:

71

answers:

3

Hello all.

Just writing out my own blog in ColdFusion and all of a sudden, I open up eclipse on my dev machine, check the site in Chrome and it doesn't load. So I tried moving Application.cfc to another folder, voila the page works.

The exact error message is:

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 contents of Application.cfc is as follows :

component 
    {
        this.name="Jake Hendy";
        this.datasource="Store";
        this.ORMenabled="true";
        this.ORMsettings.DBCreate="Update";
        ORMreload();
        void function onRequestStart(target) {
            if(structKeyexists(url,"reload-app")) {
                ORMreload();
            }
        }
    }

Any ideas people?

Many thanks,

Jake

A: 

How about:

       void function onRequestStart(target) {
            if(structKeyexists(url,"reload-app")) {
                ORMreload();
            }
              return true;
        }
Vincent Buck
Thanks for your answer! This time however I get !-- Begin Code --The function onRequestStart defined as void tried to return a value.Void functions must not return any values.!-- End CodeI must add that the above code was taken from a project while I was on Work Experience (the only thing that changed was name and datasource), in which a seasoned ColdFusion developer gave it to me. Thanks for your help again,Jake
Jake Hendy
+1  A: 

I ran the code above and it ran without error. Are you sure the error is coming from from that block of code?

Dave Ferguson
Yeah. Could it be to do with my ColdFusion set up?
Jake Hendy
It is possible. Have you upgraded your server to 9.01? If not upgrade and see if you still get the error.
Dave Ferguson
Server is 9.01. On my hosting server (sat 4m from it), it's exactly the same settings. However I have just changed the Memory from 512 to 256 on my laptop. I'll report back with my findings.
Jake Hendy
Okay, not sure which fixed it. Changed memory back to 512, and removed "return true" from my Application.cfcThanks for your help.
Jake Hendy
A: 

Removed return true from the Application.CFC, and increased memory from 256 to 512. Error now fixed....

Thanks all for your help. It has been much appreciated!

Regards,

Jake

Jake Hendy