We're updating the issue view to help you get more done. 

xmlParse doesn't work and then kills Lucee server instance

Description

Affects Version 5.3.1.95

I am using the following code on a CF11 server with no problems at all. The code merely parses out a returned set of cxml and places the contents into a database. However, the code in Lucee fails to parse the code with an error in the xmlparse function.

The XML I am trying to parse is:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.011/cXML.dtd"><cXML payloadID="7c92b177-5a6c-418c-b847-b7a4a7c79210@b2bweb" timestamp="2013-08-27T16:52:09-CDT" version="1.0"><Header><From><Credential domain="DUNS"><Identity>159148746</Identity><SharedSecret/></Credential></From><To><Credential domain="NetworkId"><Identity>Burgoon42709</Identity><SharedSecret/></Credential></To><Sender><Credential domain="NetworkId"><Identity>Burgoon</Identity><SharedSecret/></Credential><UserAgent/></Sender></Header><Message><PunchOutOrderMessage><BuyerCookie>385500</BuyerCookie><PunchOutOrderMessageHeader operationAllowed="edit"><Total><Money currency="USD">26.82</Money></Total><Shipping><Money currency="USD">0.00</Money><Description xml:lang="en">shipping charges</Description></Shipping><Tax><Money currency="USD">0.00</Money><Description xml:lang="en">tax charges</Description></Tax></PunchOutOrderMessageHeader><ItemIn lineNumber="1" quantity="1"><ItemID><SupplierPartID>49JN37</SupplierPartID><SupplierPartAuxiliaryID>WWG49JN37</SupplierPartAuxiliaryID></ItemID><ItemDetail><UnitPrice><Money currency="USD">26.82</Money></UnitPrice><Description xml:lang="en-US">TK28227971T Slip Hook Material Alloy Steel Grade 80 Hook Attachment Type Clevis Trade Size 38 In. Working Load Limit 7100 lb. Hook Opening 1-14 In. Hook Reach Length 3-1332 In. Clevis Pin Diameter 716 In. Clevis Inside Width 12 In. Orange Finish Powder Co</Description><UnitOfMeasure>EA</UnitOfMeasure><Classification domain="UNSPSC">31162611</Classification><Classification domain="Hazmat">N</Classification><ManufacturerPartID>4403515</ManufacturerPartID><ManufacturerName>CAMPBELL</ManufacturerName><LeadTime>38</LeadTime><Extrinsic name="Vendor_Min_Quantity">1</Extrinsic><Extrinsic name="FreightClassCode">18</Extrinsic><Extrinsic name="ListPrice">26.82</Extrinsic></ItemDetail><Shipping><Money currency="USD">0.00</Money><Description xml:lang="en">shipping charges</Description></Shipping><Tax><Money currency="USD">0.00</Money><Description xml:lang="en">tax charges</Description></Tax></ItemIn></PunchOutOrderMessage></Message></cXML>

I am successfully putting it into a variable called "punchout_reply".

<cfsavecontent variable="punchout_reply"><cfoutput>#trim(cxmlout)#</cfoutput></cfsavecontent>

<cfset myDoc=XMLParse("#punchout_reply#",false, "http://xml.cXML.org/schemas/cXML/1.2.011/cXML.dtd")>

Everything works well up to this point, and getting normal xml elements out of it returns good results. For example: #myDoc.cXML.Message.PunchOutOrderMessage.PunchOutOrderMessageHeader.Total.Money.xmlText#

However, when I try to parse out nodes from there, Lucee not only throws and errow, but the entire server crashes.

When I try to get the following, code the server crashes.

<cfset ItemNodes = xmlSearch(myDoc,'/cXML/Message/PunchOutOrderMessage/ItemIn')>

Loop over Item Rows

<cfloop from="1" to="#arraylen(ItemNodes)#" index="i">
<!--- The array contents need to parsed so you can easily get at the child nodes children and attributes. --->
<cfset ItemXML = xmlparse(ItemNodes[i]) />

<cfset ClassNodes = XmlSearch(ItemXML,"/ItemIn/ItemDetail/Classification") />

<cfdump var="#ClassNodes#">

</cfloop>

The error that comes back is:
cvc-elt.1.a: Cannot find the declaration of element 'ItemIn'. <br>The error occurred on line 563 in file D:\virtualwww\site_effects\clients\mis_splash\CXMLConnect\gateway\data_dumps_MIS\retrieve_grainger_cxml_order.cfm.

SAXParseException
class org.xml.sax.SAXParseException
constructors
interface exceptions
<init>(java.lang.String, java.lang.String, java.lang.String, int, int, java.lang.Exception)
<init>(java.lang.String, java.lang.String, java.lang.String, int, int)
<init>(java.lang.String, org.xml.sax.Locator, java.lang.Exception)
<init>(java.lang.String, org.xml.sax.Locator)
methods
return interface exceptions
java.lang.String toString()
int getLineNumber()
int getColumnNumber()
java.lang.String getPublicId()
java.lang.String getSystemId()
java.lang.Throwable getCause()
java.lang.String getMessage()
java.lang.Exception getException()
void printStackTrace()
void printStackTrace(java.io.PrintWriter)
void printStackTrace(java.io.PrintStream)
java.lang.Throwable fillInStackTrace()
java.lang.Throwable initCause(java.lang.Throwable)
void addSuppressed(java.lang.Throwable)
java.lang.String getLocalizedMessage()
java.lang.StackTraceElement[] getStackTrace()
java.lang.Throwable[] getSuppressed()
void setStackTrace(java.lang.StackTraceElement[])
Methods inherited from java.lang.Object
wait, wait, wait, equals, hashCode, getClass, notify, notifyAll

The following is proof that the ItemNodes variable I set contains the element ItemIn. I did a dump of ItemNodes variable and got the following.

Then when I try to get into the Lucee Administator, I get the following at the login screen in red:
cvc-elt.1: Cannot find the declaration of element 'cfLuceeConfiguration'.

Then when I try to login, I get the following error and nothing else.
We're sorry - An Error Occurred

From here, I have to completely restart the Lucee service and instance to get back to a normal login screen.

Something in the xmlparse function is completely taking down the Lucee instance and causing tons of headaches. It works fine in CF11 but doesn't in Lucee 5.3.1.95.

There has to be something wrong with parser in the Lucee engine and something wrong that makes the server crash when any xml functions are performed.

Thanks in advance for your help. I can't migrate to Lucee until I can get this resolved, as I have tons of xml parsing code functions in our code.

Environment

Windows Server

Status

Assignee

Michael Offner

Reporter

Brandon Wood

Labels

Sprint

None

Fix versions

Affects versions

5.2.6.26

Priority

Blocker