tracker issue : CF-3634391

select a category, or use search below
(searches all categories and all time range)
Title:

null pointer exception thrown every now and then

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Andrew Scott / Andrew Scott (Andrew Scott)

Created: 09/18/2013

Components: Core Runtime

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final / CF11 Update5,CF10 Update18

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Win 2008 Server

Vote Count: 6

Listed in the version 11.0.05.293506 Issues Fixed doc
Problem Description:

There seems to be a certain condition, where the getApplicationMetaData is throwing an exception. Not sure how or why this is occurring and has been seen in my application logs on Hostek for the last 10 months.

It appears that somewhere when getting the settings, it is throwing an exception on line 1246. Which seems to indicate that a variable is actually null or something, it would be nice to try to track this down. Problem is that to date, there is no known way to duplicate the problem, but looking at the code on that line may indicate better than what I can't see.



java.lang.NullPointerException at coldfusion.runtime.AppHelper.getApplicationMetaData(AppHelper.java:1246) at coldfusion.runtime.CFPage.GetApplicationMetadata(CFPage.java:10394) at cfCFORMUtil2ecfc1165099099$funcGETDEFAULTDATASOURCE.runFunction(D:\home\andyscott.id.au\wwwroot\coldbox\system\orm\hibernate\util\CFORMUtil.cfc:83) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2659) at cfCFORMUtil2ecfc1165099099$funcGETENTITYDATASOURCE.runFunction(D:\home\andyscott.id.au\wwwroot\coldbox\system\orm\hibernate\util\CFORMUtil.cfc:67) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2432) at cfVirtualEntityService2ecfc1611247811$funcINIT.runFunction(D:\home\andyscott.id.au\wwwroot\coldbox\system\orm\hibernate\VirtualEntityService.cfc:67) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3634391

External Customer Info:
External Company:  
External Customer Name: ascott67
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

Is there a particular setup/framework required to help reproduce this? Some additional information would help us look into this. (Comment added from ex-user id:vnigam)
Comment by Adobe D.
14489 | January 06, 2014 04:51:03 AM GMT
Yes it is more noticeable when using ContentBox.. There are two specific errors, one is null pointer like this and the other is property such and such no longer exists. When tracking it back to ColdBox the following code is where the error occurs, /** * Get the default application datasource */ public string function getDefaultDatasource() { // get application metadata if( listFirst(server.coldfusion.productVersion,",") gte 10 ) { var settings = getApplicationMetadata(); } else { var settings = application.getApplicationSettings(); } // check orm settings first if( structKeyExists( settings,"ormsettings") AND structKeyExists(settings.ormsettings,"datasource")){ return settings.ormsettings.datasource; } // else default to app datasource return settings.datasource; }; The line var settings - getApplicationMetadata() is where the actual problem lies, after doing something I should not do. I looked through the bytecode and found that the null pointer is occuring because it thinks there is not key associated any more, hence the null pointer. The other error is occurring on the line with the function declaration, which the exception is that getDefaultDatastore doesn't exist... Not sure of the exact error, but can wait till that one occurs again if you like to give you the details. Anyway, the one thing that I have noticed is that all this ORM stuff is running as threads, I have spoken to Luis Mjano (The author of ContentBox/ColdBox) some 6+ months ago and we are both stumped as to a reason. But I do think and I mentioned it to Luis, but it isn't something that we can easily duplicate. So it makes it hard to pin point under what exact conditions this is happening. But I do believe that it is something along the lines, that the thread is still running and at some point the application scope is gone. Hope that helps...
Comment by External U.
14490 | January 06, 2014 05:36:36 AM GMT
The other thing is that this could be a caching issue, as ContentBox uses that to cache some things. I have noticed this in another thread, where the cgi scope was no longer available when trying to log that info via a thread. Which got me into thinking that this might be what is happening with this error.
Comment by External U.
14491 | January 06, 2014 05:40:19 AM GMT
I can easily reproduce this error on CF10 Update 13. -I created a folder with two files: Application.cfc component { this.name="test"; this.ormEnabled="true"; this.datasource="test123"; } index.cfm <cfdump var="#getApplicationMetadata().DATASOURCE#"> I pointed 10 JMeter threads at it and within a minute had produced several errors. Error Occurred While Processing Request Element DATASOURCE is undefined in a CFML structure referenced as part of an expression. and java.lang.NullPointerException at coldfusion.runtime.AppHelper.getApplicationMetaData(AppHelper.java:1246) at coldfusion.runtime.CFPage.GetApplicationMetadata(CFPage.java:10402) at cfindex2ecfm1520861839.runPage(C:\Users\Brad.development\Documents\scribble.dev\newApp\index.cfm:1) This only took a few minutes to set up and doesn't use any frameworks or anything. Please replicate this so you can find the concurrency issue and fix it.
Comment by External U.
14492 | July 20, 2014 08:57:36 PM GMT
Thanks brad for finding a reproduceable way. Shame on me for not thinking of doing that. However, I have even seen this with only one user as well. Makes me wonder what sort of concurrency issues are really going on here.
Comment by External U.
14493 | July 20, 2014 11:44:01 PM GMT
Yeah, I see this too on our application with high volume.
Vote by External U.
14501 | July 23, 2014 10:53:04 AM GMT
Please make getApplicationMetaData() thread safe.
Vote by External U.
14502 | July 23, 2014 12:45:02 PM GMT
Please fix this. Please, please, please.....
Vote by External U.
14503 | July 23, 2014 01:19:42 PM GMT
unexplained errors undermine confidence
Vote by External U.
14504 | July 23, 2014 04:00:07 PM GMT
I'd check all recent version of ColdFusion including 9, 10 and 11.
Vote by External U.
14505 | July 23, 2014 06:39:07 PM GMT
Null pointer exceptions are particularly difficult to debug and undermine the language as a whole.
Vote by External U.
14506 | July 24, 2014 02:25:14 AM GMT
Please test it on the latest build..
Comment by Awdhesh K.
14494 | November 02, 2014 11:44:23 PM GMT
The fix for this bug is available in the pre-release build of ColdFusion 11 Update 5
Comment by CFwatson U.
14495 | February 20, 2015 09:23:50 AM GMT
When I JMeter, I get a few java.util.ConcurrentModificationException in CF11 Update 5 (build 11,0,05,293506). Would this ticket cover that exception as well, or should I log another ticket? Here's the full error: "Error","ajp-bio-8014-exec-3174","09/03/15","20:44:25","ticket_CF-3634391","'' The specific sequence of files included or processed is: C:\websites\mysitecomcf11\www\_tickets\CF-3634391\index.cfm, line: 6 " java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(Unknown Source) at java.util.HashMap$EntryIterator.next(Unknown Source) at java.util.HashMap$EntryIterator.next(Unknown Source) at coldfusion.runtime.LocalScope$LocalScopeSet.<init>(LocalScope.java:531) at coldfusion.runtime.LocalScope.entrySet(LocalScope.java:200) at java.util.AbstractMap$1$1.<init>(Unknown Source) at java.util.AbstractMap$1.iterator(Unknown Source) at coldfusion.runtime.AppHelper.getApplicationMetaData(AppHelper.java:1337) at coldfusion.runtime.CFPage.GetApplicationMetadata(CFPage.java:11249) at cfApplication2ecfcCF-305613702$funcONREQUESTSTART.runFunction(C:\websites\mysitecomcf11\www\_tickets\CF-3634391\Application.cfc:6) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:643) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:432) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:402) at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:108) at coldfusion.runtime.AppEventInvoker.onRequestStart(AppEventInvoker.java:279) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:455) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:42) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:142) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
Comment by External U.
14496 | September 03, 2015 03:38:09 PM GMT
[continued] at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at coldfusion.CfmServlet.service(CfmServlet.java:219) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:422) at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:199) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) Application.cfc: ---------------------- component { THIS.name = "ticket_CF-3634391"; THIS.datasource = "MyDSN"; THIS.ormEnabled="true"; boolean function onRequestStart() { writeDump(getApplicationMetadata().datasource); return true; } } Thanks!, -Aaron
Comment by External U.
14497 | September 03, 2015 03:38:26 PM GMT
We are on CF10 (10,0,17,295085) and experiencing this problem. We aren't likely to upgrade to CF 11 and it seems CF12 is a long way off still. Can we get a fix for CF 10? The problem occurs in a thread when a SQL call is made using the following code: <cfstoredproc procedure="GetStoresForSearch" datasource="#GetApplicationMetaData().datasource#" returncode="false" > coldfusion.runtime.CustomException: Element DATASOURCE is undefined in a CFML structure referenced as part of an expression. at coldfusion.tagext.lang.ThrowTag.doStartTag(ThrowTag.java:142) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2795) at cfmall2ecfc1230261222$funcGETSEARCHMASHUP.runFunction(C:\inetpub\iconsumer\cfc\mall.cfc:250) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2428) at cfSearch2ecfm346944654._factor6(C:\inetpub\iconsumer\html\Search.cfm:11) at ...
Comment by External U.
14498 | September 08, 2015 03:55:14 PM GMT
Sanford, The fix for this bug is incorporated with update 18 of CF10. (https://helpx.adobe.com/coldfusion/kb/bugs-fixed-in-coldfusion-10-update-18.html) Can you verify if applying the update, fixes the issue for you.
Comment by Piyush K.
14499 | March 11, 2016 03:12:53 AM GMT
Hi Piyush, I noted CF11 Update 5 still throws java.util.ConcurrentModificationException. Please see my comment on Sep 3, 2015. It includes the code. Should I log another ticket for that exception? Or that is expected? Thanks!, -Aaron
Comment by External U.
14500 | March 11, 2016 02:29:03 PM GMT