So here is a weird one for you. I've got a bug report over on my Soundings forum where a user reports getting NPEs (Null Pointer Exceptions). The errors are random, and go away immediately if you refresh the page. If you read the thread, you will see that HostMySite is saying it is an issue with ColdFusion 8 and MySQL. Their "solution" is to roll back the client to ColdFusion 7.
Now what's odd is - I have a client who uses HostMySite, and they were having the same issues. Not with Soundings, but just with their CF code in general. (CF8+MySQL)
I finally put two and two together a few minutes ago. Is anyone else experiencing this? I've checked the client's code for obvious issues - and while I found a missing var statement or two - those were all patched up. The site has no load now at all.
Archived Comments
FYI, I forgot my earlier post on this:
http://www.coldfusionjedi.c...
I wonder if we are seeing a bug in CF8+MySQL?
I just launched a pretty intensive CMS on CF8 + MySQL 5 on a crystaltech.com semi-dedicated server and have no issues like that that I am aware of.
Ray, I got a number of these when I switched my site to be hosted by HMS. It is running CF8 and MySQL. The solution was to toggle and/or adjust the "Maintain Client Connections" and the Connection Timeout Settings. I have had no issues since the first day or two since these adjustments were made.
Ray, that earlier post about the NPEs was in fact CF8 plus MySQL. I have had no problems at all since the OnRequest "fix" from the CT tech, though none of us seems to yet understand why it worked!
We were having weird problems as well. The cause turned out to be that the particular server our site was on was UPGRADED from cf7 to cf8. Apparently this is cause of a lot of these weird issues. If you call HostMySite they will switch your website over to a server that cf8 was freshly installed on.
I had some weird issues with cfm8 vps servers but soon as I switched to a cfm8 ded box they all went away.
I know that helps but..... it seems as though the config has some issues to be worked out on cfm8.
This sounds like an issue I experienced repeatedly with HMS when and MySQL. To fix it, I had to go back into the DSN in the CF Admin and uncheck the box "Maintain connections across client requests." The error messages disappeared immediately.
I don't recall whether NPEs were a part of the error messages I received, but it sounds very familiar.
I have developmed my own CMS using CF8 and MySQL on crystaltech.com and no errors what so ever, there must be something odd with host my site or soundings :P hehehe just kidding
Maybe it's an issue with the mySQL driver? Maybe CF is maintaining a connection but the DB server is dropping it then boom! NPE. Or something. It's early.
I did report a bug where I was getting an intermittent "corrupt table" error with MySQL/CF8/cfqueryparams.
They said that one's been fixed and will be in the next hotfix.
They also sent me the fix. I don't know if it's related at all tho. Doesn't sound like it..
Will
I had some problems on HMS just this last week installing BlogCFC w CF8 + MySQL: worked perfectly on Dev machine, but they were using the wrong MySQL driver on the DSN at HMS. Threw lots of errors, so it got fixed; then I started getting random timeouts when reinitializing the cache; So I request ?autoconnect=true added to the connection string and that seems to have worked thus far.
Before that, Occasionally, when I selected category view on Blog CFC I'd get a Null Pointer - and I had no idea why....
I had the same problem on a site running CF and mySQL hosted at HostmySite. The problem began when HMS upgraded to CF8. But in my case the support was good and they fixed my Null Pointer Exceptions. So I asked more informations about how they solved it. They answered:
The fix was to add the following to the connection string for the DSN in ColdFusion Admin:
zeroDateTimeBehavior=convertToNull
The fix has to to do with a bug in MySQL referenced here:
http://bugs.mysql.com/bug.p...
When using the MySQL 3.x drivers in CF7 this issue never revealed itself, but when upgrading to CF8 and using the MySQL 4/5 drivers, it popped up. Please let us know if you have any additional questions about this issue.
" 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."
I'm actually getting those, too.
We're using CF8 that's connecting to a mySQL database on another network.
Refreshing the page causes the error to disappear.
Randomly just found this posting. Glad I did.
Added that to the connection string. Still getting the errors.
According to an email I received from Alagad, a fix is now posted:
http://kb.adobe.com/selfser...
I have the same problem - and I have a pretty simple page with the HostMySite people. I'll try the connection string change, and see if someone can implement the Hot Fix. Crossing my fingers.....
This problem is probably related to a bug in CF8 mysql driver.. having HMS remove the "maintain connections" option from the DSN config should fix the problem.
Havnt seen the new Adobe hotfix on this yet. will have to check it out.
Null pointer exceptions.
We upgraded our server from CFmx7 to CF8 about a month ago with no issues until now. We are now getting intermittent NPEs. If you refresh a page, the error either goes away or shows a different NPE error. This was all working fine for a month after the upgrade.
We have CF8 installed on CentOS 3.8 with Mysql 4.1.
I have restarted CF8 and the issue is still persisting. I also updated with the CFhotfix 2 and restarted with the issue still persisting.
I'm thinking of uninstalling and reinstalling CF8 tonight. I will post my result.
I've given up for today.
Uninstalled Coldfusion 8 and did a complete re-install with no improvements. Still getting random intermittent Null Pointer Exceptions.
I talked with our server tech support and they informed me that Apache failed earlier today and had to restart. Thats about when this problem started. They re-compiled apache and I uninstalled and re-installed coldfusion again. This time the errors were less frequent but still there.
I'm not convinced that its a coldfusion issue since it worked without any issues for a month straight.
I also read on a forum that it may be the mysql 4/5 driver so I used the "other" setting for the datasource and the manual driver setup like you had to with CFMX7. Still same issue. Different errors every time you refresh.
Tomorrow i plan to install cfmx7 to test if the problem still occurs.
Will post my results
You may want to consider checking the version of MySQL you are using and ensuring that the connector is the same version. Thats another tip I've heard.
It seems to be working now.
Thanks Raymond and Matteo!
So initially, the mysql connection string (zeroDateTimeBehavior=convertToNull) didn't work, and unchecking the (Maintain connections across client requests)didn't work. After a third install of cf8 we still got the errors until I put the connection string in with the driver I used with cfmx7 as well as unchecking the Maintain connections across client requests option. Now its been working for over a day with no issues.
What puzzles me is why did it work for a month without any issues using the native Mysql 4/5 drivers?
I had the same problem on 3 of my websites (shared server) with CrystalTech (now Newtek). The tech knew the fix immediately. The cold fusion admin for 7 was defaulted to have the checkbox for maintain connection unchecked, but cf8's default was checked. what's the word on a fix for the dsn/mysql issue? it would be nice to be able to maintain connections.
I was told, by Adobe, that they are not planning on fixing the issue in CF8, but "hopefully" it will work in CF9.
I'm getting this now anytime I try to instantiate a CFC at Network Solutions CF hosting (client's choice, not mine). The db is Access, and I'm not even accessing it in the test CFC I wrote to show the problem to them. All I'm doing in my test CFC is returning the string 'foo' when it's called with cfinvoke.
They're running CF7, no CF8 servers, and very very little support from them. Client is running out of patience and is starting to talk "cf sucks, knew we should have converted the app to ASP".
Site - with some pretty complex CFCs works fine on my test server (CF8), and a 2nd server I installed the site on to show it to them working (CF7).
"Comment 23 written by Matt on 24 September 2009, at 8:49 AM
I was told, by Adobe, that they are not planning on fixing the issue in CF8, but "hopefully" it will work in CF9"
"hopefully" it will work in CF9" --- Yeah and pay another $10 Grand for another licence
CF9 Enterprise, full price, isn't 10k. The upgrade for sure is a lot less.
CrystalTech customers can refer to this knowledgebase article below. It instructs contacting customer support to turn off the "maintain connections across client requests" that is enabled by default.
http://help.webcontrolcente...
We were having the same problems with several sites based on a cf8/mysql5 installation. After the addition of the connection String "zeroDateTimeBehavior=convertToNull" as mentioned above by Matteo Stagi AND removing the "maintain connections" option from the DSN config everything works fine. Thanks
Need to update a setting. I called Host My Site and the fixed the issue right away.
This is an old article, but for anyone that cares this bug is still around and is not specific to ColdFusion 8 and mySQL. I'm using CF8 and MSSQL 2005 and I get this bug randomly when I instance a CFC. The problem immediately goes away when I hit refresh.
One interesting thing is that this only appears to happen after a fresh reboot of the server.