For the past 16 months I've been reading an XML document with cffile and 
parsing it into an application variable, all within an exclusive cflock 
on the application scope. From there, I copied the parsed document using 
duplicate() into the request scope for use throughout my application. 
About three weeks ago this duplicate call began throwing errors. Since 
then several other of my sites began throwing this error, all of them 
are hosted at HostMySite CF+ shared hosting. The issue is intermittent, 
happening for around 3-6% of the requests to the site, depending upon 
which one.

The errors encountered are (and they usually appear in this order):

*   The typical "null null" NPE error, java.lang.NullPointerException.

*   INVALID_CHARACTER_ERR: An invalid or illegal XML character is 
specified. null 

--- Stack trace ---
org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal 
XML character is specified. at 
org.apache.xerces.dom.CoreDocumentImpl.createElement(Unknown Source) at 
org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source) at 
org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source) at 
org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source) at 
org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source) at 
org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source) at 
coldfusion.xml.XmlNodeList.Duplicate(XmlNodeList.java:319) at 
coldfusion.runtime.ObjectDuplicator._duplicate(ObjectDuplicator.java:105) 
at 
coldfusion.runtime.ObjectDuplicator.duplicate(ObjectDuplicator.java:63) 
at 
coldfusion.runtime.ObjectDuplicator._duplicate(ObjectDuplicator.java:126) 
at 
coldfusion.runtime.ObjectDuplicator.duplicate(ObjectDuplicator.java:63) 
at coldfusion.runtime.CFPage.Duplicate(CFPage.java:4775) at 
cfApplication2ecfm703397020._factor8(C:\Websites\162552du7\Application.cfm:118) 
at 
cfApplication2ecfm703397020.runPage(C:\Websites\162552du7\Application.cfm:1) 
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)

*   NAMESPACE_ERR: An attempt is made to create or change an object in a 
way which is incorrect with regard to namespaces. null

--- Stack trace ---
org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or 
change an object in a way which is incorrect with regard to namespaces. 
at org.apache.xerces.dom.ElementNSImpl.setName(Unknown Source) at 
org.apache.xerces.dom.ElementNSImpl.<init>(Unknown Source) at 
org.apache.xerces.dom.CoreDocumentImpl.createElementNS(Unknown Source) 
at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source) at 
org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source) at 
org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source) at 
org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source) at 
coldfusion.xml.XmlNodeList.Duplicate(XmlNodeList.java:319) at 
coldfusion.runtime.ObjectDuplicator._duplicate(ObjectDuplicator.java:105) 
at 
coldfusion.runtime.ObjectDuplicator.duplicate(ObjectDuplicator.java:63) 
at 
coldfusion.runtime.ObjectDuplicator._duplicate(ObjectDuplicator.java:126) 
at 
coldfusion.runtime.ObjectDuplicator.duplicate(ObjectDuplicator.java:63) 
at coldfusion.runtime.CFPage.Duplicate(CFPage.java:4775) at 
cfApplication2ecfm1694192392._factor8(C:\Websites\169704wt9\Application.cfm:118)
 
at 
cfApplication2ecfm1694192392.runPage(C:\Websites\169704wt9\Application.cfm:1) 
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)


I've tried replacing the XML documents to make sure they haven't become 
corrupt, but despite this I've never run into any issues reading or 
parsing the file, only when trying to duplicate it.


Here's the guts of the application file.

<cflock scope="APPLICATION" type="readonly" timeout="60">
    <cfset request.apploaded = IsDefined('APPLICATION.apploaded')>
</cflock>

<cfif NOT request.apploaded OR isDebugMode()>
    <cflock scope="APPLICATION" type="exclusive" timeout="45">

    <cfif fileExists(expandPath('./themes/templates.xml'))>
        <cffile action="read" 
file="#expandPath('./themes/templates.xml')#" variable="xTemplate"/>
        <cfset APPLICATION.templates = xmlParse(xTemplate)/>
    </cfif>

    <cfset APPLICATION.apploaded = TRUE>
    </cflock>
</cfif>

<cflock scope="APPLICATION" type="readonly" timeout="60">
    <cfset request.application = duplicate(APPLICATION)/>
</cflock>



Has anyone seen any of these issues? HMS support has not be helpful in 
resolving the issue. I am forcing the application scope to rebuild 
itself at this point to limit the effect of the issue, but even still 
it's getting out of hand. Any help would be highly appreciated.

Thanks,
Mike









~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:311959
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to