org.xml.sax.SAXException - Cannot find the declaration of element


#1

Hi,

We have recently started to experience a problem with parsing XML files on a Windows server. The issues is logged in here:
https://luceeserver.atlassian.net/browse/LDEV-1645

It results in the Lucee service requiring a re-start and the Lucee admin breaking.

The server will run fine for a week or so before it blows up. Most of the applications on the server are using XML files for configuration, so it is starting to cause us real problems.

I was just wondering if anybody else has experienced this or has any ideas on how to go about either debugging it or fixing it???

Thanks, Martin

PS. The error showing up in the admin is:

Lucee 5.2.6.60 Error (org.xml.sax.SAXException) 
Message cvc-elt.1.a: Cannot find the declaration of element 'language'. 
Stacktrace The Error Occurred in
/admin/resources/text.cfm: line 206 
called from /admin/resources/text.cfm: line 17 
called from /admin/web.cfm: line 148 
called from /admin/server.cfm: line 2 
 
Java Stacktrace lucee.runtime.exp.NativeException: cvc-elt.1.a: Cannot find the declaration of element 'language'.
 	at lucee.runtime.text.xml.ThrowingErrorHandler.error(ThrowingErrorHandler.java:40)
 	at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
 	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
 	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
 	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
 	at lucee.runtime.text.xml.XMLUtil.parse(XMLUtil.java:262)
 	at lucee.runtime.text.xml.XMLUtil.parse(XMLUtil.java:229)
 	at lucee.runtime.functions.xml.XmlParse.call(XmlParse.java:47)
 	at lucee.runtime.functions.xml.XmlParse.call(XmlParse.java:37)
 	at resources.text_cfm$cf.udfCall(/admin/resources/text.cfm:206)
 	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:107)
 	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357)
 	at lucee.runtime.type.UDFImpl.call(UDFImpl.java:226)
 	at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:771)
 	at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:756)
 	at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1698)
 	at resources.text_cfm$cf.call(/admin/resources/text.cfm:17)
 	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:939)
 	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:833)
 	at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:817)
 	at web_cfm$cf.call(/admin/web.cfm:148)
 	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:939)
 	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:833)
 	at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:817)
 	at server_cfm$cf.call(/admin/server.cfm:2)
 	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:939)
 	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:833)
 	at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:223)
 	at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:43)
 	at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2405)
 	at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2395)
 	at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2363)
 	at lucee.runtime.engine.Request.exe(Request.java:44)
 	at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1091)
 	at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1039)
 	at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:102)
 	at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:62)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
 	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
 	at com.seefusion.Filter.doFilter(Filter.java:49)
 	at com.seefusion.SeeFusion.doFilter(SeeFusion.java:1500)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474)
 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
 	at mod_cfml.core.invoke(core.java:152)
 	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
 	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)
 	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
 	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798)
 	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434)
 	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 	at java.lang.Thread.run(Thread.java:745)
 Caused by: org.xml.sax.SAXException: cvc-elt.1.a: Cannot find the declaration of element 'language'.
 org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 36; cvc-elt.1.a: Cannot find the declaration of element 'language'.
 	... 76 more
 Caused by: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 36; cvc-elt.1.a: Cannot find the declaration of element 'language'.
 	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
 	... 75 more

#2

Quick update on this issue.

The reporter of the bug advised me that they solved this by removing the use of validation within the XmlParse method.

I tested this locally and was able to replicate the issue using validation within XmlParse:

XmlParse(variables.sitemap, true, "http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd")

The validation appears to fail, even with a valid XML file. Once it does, XmlParse break for the Lucee instance and it requires a restart.

I have simply removed the validation to hopefully resolve this for now.

Regardless of whether or not the XML is correct, Lucee should not fail in this way so this definitely looks like a bug.

The ticket has been updated with this information.