• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Null Pointer Exception on XML Functions

Guest
Nov 30, 2007 Nov 30, 2007

Copy link to clipboard

Copied

I've been experiencing some problems using some Cold Fusion XML features with a XML structure in the Request scope.

I'm getting NullPointerException errors but just intermittently. I would estimate the error appears on somewhere between 1 in 15 and 1 in 30 requests.

The problem seems to get worse the more concurrent requests the server is receiving.

If anyone has any insights, that would be great. If not, I may go another route with the code.

-- Ethan

Ethan Goldstine
Producer, kapow, inc.
ethan@kapow.com

* * *

Line 65:

Code: <cfset thisText = aSection.text.XmlText />

Error ID: CF_NEOPAGECONTEXT

Stack: java.lang.NullPointerException
at coldfusion.xml.XmlNodeMap.resolveElementName(XmlNodeMap.java:592)
at coldfusion.xml.XmlNodeMap.resolveName(XmlNodeMap.java:662)
at coldfusion.runtime.Scope.get(Scope.java:60)
at coldfusion.runtime.DotResolver.resolve(DotResolver.java:44)
at coldfusion.runtime.DotResolver.resolve(DotResolver.java:71)
at coldfusion.runtime.DotResolver.resolve(DotResolver.java:87)
at coldfusion.runtime.NeoPageContext.SymTab_resolveSplitName(NeoPageContext.java:945)
at coldfusion.runtime.CfJspPage.resolveCanonicalName(CfJspPage.java:1657)
at coldfusion.runtime.CfJspPage._resolve(CfJspPage.java:1600)
at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:1735)
at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:1728)
at cfnav2ecfc1894117078$funcGENERATETOPNAV.runFunction(D:\siteroot\code\cfcs\nav.cfc:65)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:56)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2464)
at cfnav2ecfc1894117078$funcINIT.runFunction(D:\siteroot\code\cfcs\nav.cfc:44)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:56)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2260)
at cfglobal_header2ecfm414818872.runPage(D:\siteroot\shared\objects\global_header.cfm:11)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:192)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:366)
at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:2644)
at cfheader2ecfm397328118.runPage(D:\siteroot\wdch\objects\header.cfm:9)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:192)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:366)
at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:2644)
at cfindex2ecfm1047256184.runPage(D:\siteroot\wdch\visit\index.cfm:20)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:192)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:366)
at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:2644)
at cfApplication2ecfc157975882$funcONREQUEST.runFunction(D:\siteroot\wdch\Application.cfc:29)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:56)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308)
at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:74)
at coldfusion.runtime.AppEventInvoker.onRequest(AppEventInvoker.java:243)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:269)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:74)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.CfmServlet.service(CfmServlet.java:175)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)



Line 145:

Code: <cfif structKeyExists(anItem,"subnav")>

Error ID: CF_CFPAGE

Stack: java.lang.NullPointerException
at coldfusion.xml.XmlNodeMap.resolveElementName(XmlNodeMap.java:592)
at coldfusion.xml.XmlNodeMap.resolveName(XmlNodeMap.java:662)
at coldfusion.xml.XmlNodeMap.containsName(XmlNodeMap.java:674)
at coldfusion.runtime.Scope.containsKey(Scope.java:105)
at coldfusion.runtime.Struct.StructKeyExists(Struct.java:577)
at coldfusion.runtime.CFPage.StructKeyExists(CFPage.java:3457)
at cfnav2ecfc1894117078$funcGENERATESUBNAVSEGMENT.runFunction(D:\siteroot\code\cfcs\nav.cfc:145)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:56)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2429)
at cfnav2ecfc1894117078$funcGENERATETOPNAV.runFunction(D:\siteroot\code\cfcs\nav.cfc:69)
[...same as above]


Line 146:

Code: <cfif structKeyExists(anItem["subnav"].XmlAttributes,"active")>

Error ID: CF_XMLNODELIST

Stack: java.lang.NullPointerException
at coldfusion.xml.XmlNodeMap.resolveElementName(XmlNodeMap.java:592)
at coldfusion.xml.XmlNodeMap.resolveName(XmlNodeMap.java:662)
at coldfusion.runtime.Scope.get(Scope.java:60)
at coldfusion.xml.XmlNodeList.ArrayGet(XmlNodeList.java:188)
at coldfusion.runtime.CfJspPage.ArrayGetAt(CfJspPage.java:881)
at coldfusion.runtime.CfJspPage._arrayGetAt(CfJspPage.java:919)
at coldfusion.runtime.CfJspPage._arrayGetAt(CfJspPage.java:914)
at coldfusion.runtime.CfJspPage._arrayGetAt(CfJspPage.java:692)
at coldfusion.runtime.CfJspPage._arrayGetAt(CfJspPage.java:678)
at cfnav2ecfc1894117078$funcGENERATESUBNAVSEGMENT.runFunction(D:\siteroot\code\cfcs\nav.cfc:146)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:56)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2429)
at cfnav2ecfc1894117078$funcGENERATETOPNAV.runFunction(D:\siteroot\code\cfcs\nav.cfc:69)
[...same as above]

More in attached code...

TOPICS
Advanced techniques

Views

532

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 30, 2007 Nov 30, 2007

Copy link to clipboard

Copied

LATEST
Show us the code that generates the erroring XML.

Try putting a try/catch around the line erroring and writing some info to
file, like a dump of the XML doc, and any relevant variables in the
template.

--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation