![]() |
| Null Pointers |
|
Seamus
|
Hello All,
I'm still new to ColdFusion, so bare with me while I try to describe my problem. I keep getting this error, seemingly at random:
I set all those variables in the Application.cfc using this code...
When I dump the application object, all those variables show up correctly, so I can't begin to think why it's causing an exception. Anyone have any ideas? |
||||||||||||||
|
|
|||||||||||||||
|
emmet
|
Did you set all the settings correctly in settings.ini?
|
||||||||||||
|
|
|||||||||||||
|
Seamus
|
Sorry, like I said I'm new to this.
I don't know if setting.ini is there or if I have to create it. I had originally written the datasource name, username, and password directly in Application.cfc (Where you see mypassword etc). After reading your post and doing a little research, I realized that I didn't need to add the username and password. (like I said I'm new to this I haven't been able to do any extensive testing, but I haven't seen the error since making that change. Do you think that could have been the source of my error? |
||||||||||||
|
|
|||||||||||||
|
emmet
|
Definitely the source of your issue. Blogcfc only needs the ini edit and your fine. Just remember to ?reinit after making any code changes and you'll be fine.
|
||||||||||||
|
|
|||||||||||||
|
Seamus
|
So, it looks like the problem persists.
I apologize once again, but I don't really understand what you mean by "reinit"-ing. I though that by setting the datasource on "onRequestStart", it would check to see if it's defined every server request, but it sounds like it's not as simple as that. |
||||||||||||
|
|
|||||||||||||
|
emmet
|
By reinit i mean add ?reinit=1 at the end of your url to dump the application scope. If your blog url is www.foo.com/blog then go to www.foo.com/blog/?reinit=1.
This is just for this application, its not a built in function in cf. BlogCFC just happens to cache the cfc in the application scope and uses ?reinit as a way to dump the application and reload. |
||||||||||||
|
|
|||||||||||||
|
Seamus
|
I'm still a bit confused.
Are you under the impression that I'm using Raymond Camden's BlogCFC? Is this something that applies to that specifically? |
||||||||||||
|
|
|||||||||||||
|
Seamus
|
Ok, so I hit upon something that gives me a better clue what I'm dealing with while working in Flex. I'm connecting to a completely different cfc, which has no Application file and explicitly spells out the dsn, and I'm still getting the error. So the problem doesn't appear to have anything to do with my Application file. Perhaps it's a problem with the sandbox settings or the way the dsn was declared.
|
||||||||||||
|
|
|||||||||||||
|
Seamus
|
So for anyone who runs into this problem, it appears to be caused by the setting "Maintain connections across client requests." under the datasource advanced settings.
I don't know the specifics of why it causes the problem, but having it unchecked has cleared it all up for me. |
||||||||||||
|
|
|||||||||||||
|
nathacof
|
We've seen this for a number of our customers going from CF7 -> 8. Unfortunately I'm not any more sure of why it's occurring than you. Sorry I hadn't read the thread earlier. |
|||||||||||||
|
|
||||||||||||||
|
dreamplanner
|
I get the same Null Pointers error. It seems to happen the first time I visit any page that has a database call. If I refresh the browser, the page loads fine.
So, where do I find the "datasource advanced settings"? Is there something else that might be causing the problem? |
||||||||||||
|
|
|||||||||||||
|
tedjtw
|
If you are using MySQL with CF8 there is an issue with the DSN maintain connections settings.
The setting is enabled by default. Which is correct since then a new connection to the database is not needed for every page view. However there is a little known problem. Most of the time the DSN info is in Application.cfm or .cfc. The .cfm is read each time a page is viewed. So the chances of the 'bug' biting on any given page are pretty good. Not always, but fairly often. Drove us nuts. Have HMS support uncheck the maintain connections option for your DSN in CF Admin. That should stop it. Of course if you are not using MySQL then ....................? BTW, this does not happen on our in-house servers at all, just shared so far. I kinda guess the other wildcard here is the sandbox. We don't use it in house. HTH |
||||||||||||
|
|
|||||||||||||
| Null Pointers |
|
||
|


