Copy link to clipboard
Copied
After running on CF9 happily for approx 10 months I am suddenly getting intermittent java.lang.NullPointerException errors which appear to trigger at the cfapplication tag in Application.cfm with a diagnostic message of "null null".
I have not been able to re-produce the error myself but it is appearing occassionally when others are accessing the site. I have not changed any settings or made changes to application.cfm or the cfapplication tag.
It appears that faults such as this appeared in previous releases of CF but I never had the same problem in CF5.0 and have been running well on CF9 up until now.
Any thoughts as to where I might look?
Copy link to clipboard
Copied
If you haven't already, I would suggest you upgrade to 9.0.1. Other than that, I'm sorry to say I haven't seen that issue and can't be of more assistance.
Copy link to clipboard
Copied
Most of the time I see null null errors is when dealing with xml data that is stored in the application or session scope. While not efficient, the following seems to work:
<!--- sometime earlier, probably at application startup --->
<cfset application.xml = xmlParse("somefile.xml") />
<!--- during request --->
<cfset request.myXML = duplicate(application.xml) />
<cfset variables.whatever = xmlSearch(request.myXML, "/employee/name/last") />
I've found that using application.xml directly, without going through the duplicate step, will generate null null errors indicating that something in the xml walking logic in CF or Java is not thread safe.
Another work around, which may or may not be as efficient, is using a cflock around the xmlSearch.
Copy link to clipboard
Copied
As Sean says, you should indeed upgrade to Update 1 of ColdFusion 9 (that is, to ColdFusion 9.0.1), and apply the latest hot fix. The updater fixes at least one issue with the cfapplication tag.