![]() |
| Null Pointers exception error. in CFCs |
|
darnold
|
I'm having a problem what is a bit hard to explain but I will do my best.
I'm using functions defined in a cfc file to run certain queries. It's an OOP design pattern that I've used for a long time in PHP and this is the first time I've tried to use it in CF. The code works great as long as you don't pause on the site for more than 5 minutes. There is a 5 minutes pause the CFC will drop the variable scopes and deliver a Null Pointers exception error. From what I can tell it's not picky about what struck or scope gets lost. It appears to have more to do with time. Depending on what page I'm on it might complain about something in the form struck or on another page it complains about an item in the application scope or even the session scope. One thing is for sure the error is consistent. 5 minutes after the class as been instantiated if no action occurs the next click will result in a null pointer error. If I refresh the page everything goes back to peachy until another 5 minute pause in activity occurs. In my cfapplication tag I made sure sessionmanagement is on and I set the time out on the application scope to 2 days which is the default at HMS anyway. This is the easies example to see. Go to http://laweightlosssurgery.com/index2.cfm the page should load fine. Wait 5 minutes and back to http://laweightlosssurgery.com/index2.cfm to see the error. If you refresh at that point the error goes away. Anyone see this before or have any idea on fixing it? |
||||||||||||
|
|
|||||||||||||
|
darnold
|
Looks like this one has got a few people puzzled. I'd like to add my example of the problem on http://laweightlosssurgery.com/index2.cfm was calling the functions with cfinvoke.
I created another copy of the file using one cfobject instead and the result is the same on http://laweightlosssurgery.com/index4.cfm. Also the problem is not limited to losing variable. It would appear Coldfusion has a temporary glitch and forgets how to process anything in wrapped in pound symbols. These test pages error using
I changed that to
and the error moved down to where I use
|
|||||||||||||||||
|
|
||||||||||||||||||
|
nathacof
|
[edit]Shoulda read the post more thoroughly[/edit]
|
||||||||||||
|
|
|||||||||||||
|
darnold
|
Well Now I'm completed confused and rather frustrated. In an effort to just "make it work" I converted everything to using functions without using classes. I figured the problem has to be with the cfc but low and behold the problem still exists and I'm not even using cfcs anymore.
If nothing else I'm finding more ways to get the same error. |
||||||||||||
|
|
|||||||||||||
|
bobclingan
Forum Regular
|
Could you make your source code available? It may be useful to look at the cfc in question.
|
||||||||||||
|
|
|||||||||||||
|
darnold
|
Sure thing. I got the problem calling any function that uses # pounds signs in the function.
Here is one of them. Also to get the problem the function doesn't need to be in a cfc. index4.cfm is writtne this way. instantiate the class:
call the function
display results
includes/cfcs/index.cfc is written this way
|
||||||||||||||||||||
|
|
|||||||||||||||||||||
| Problem Solved! |
|
darnold
|
At least as far as I'm concerned it is. I moved the site to another server today and no more error. Happy Day!
|
||||||||||||
|
|
|||||||||||||
| Re: Problem Solved! |
|
Jason101
Forum Regular
|
Strange..Maybe there was a problem with the CF configuration on the other server. I was contemplating your problem for a while, and couldn't put my finger on it. Glad to hear you have it fixed |
||||||||||||||
|
|
|||||||||||||||
| Null Pointers exception error. in CFCs |
|
||
|


