Error when using XMLParse to read XML data

Note:

Applies to: ColdFusion (2016 release) and ColdFusion (2018 release).

Issue

After using the XMLParse function to read an XML file, the following error message appears:

IllegalArgumentException is reported

This issue occurs on Red Hat JBoss Enterprise Application Platform due to incorrect class loading.

Workaround

If the ColdFusion server is already  running, execute the code below:   

<cfset a=createobject("java","java.lang.System")> 
<cfset a.setProperty("javax.xml.transform.ransformerFactory","org.apache.xalan.processor.TransformerFactoryImpl")> 
<cfset a.setProperty("javax.xml.parsers.SAXParserFactory","org.apache.xerces.jaxp.SAXParserFactoryImpl")> 
<cfset a.setProperty("javax.xml.parsers.DocumentBuilderFactory","org.apache.xerces.jaxp.DocumentBuilderFactoryImpl")> 
<cfset a.setProperty("org.apache.xerces.xni.parser.XMLParserConfiguration","org.apache.xerces.parsers.XML11Configuration")> 

See onServerStart for more information.

If you are restarting the server, run this code again.

Get help faster and easier

New user?