Bizarre error when using CFFILE to upload html files

Hi all,
I’m getting this bizarre, intermittent (of course!) error when using CFFILE to upload a .htm file. It’s fine for days and then suddenly, I get this error.

“Could not initialize class org.apache.tika.utils.XMLReaderUtils”

The code is pretty simple - form (with enctype set correctly) and on the other end:

OS: Windows Server 2012 R2 Standard
Java Version: 11.0.22 (Eclipse Adoptium) 64bit
Tomcat Version: Apache Tomcat/9.0.86
Lucee Version: 6.0.1.83

For good measure, I’ve got a setting in my Application.cfc like so:

I’m getting this funny intuition that, somehow, a Java component “goes away” or something, but that’s purely intuition.

Any ideas? I’ve Googled (a lot) and can’t find anything comparable.

Hope someone can help

Mike Horne

so?
I think there’s a piece of code missing :sweat_smile:

Sorry, I misread. There is a another known issue with the tika MimeTypesReader and I thought that was it but I see you are having another tika issue where it’s parsing the htm file with the XML parser.

Also, you might be able to update the tika lib in \tomcat\lucee-server\bundles.

I remember they were using a pretty outdated version in 5.x, not sure about 6.

https://tika.apache.org/

I’m still getting this problem. It’s fine, and then suddenly it isn’t. Restarting Lucee fixes it.

This is the start of the stack trace:

lucee.runtime.exp.NativeException: Could not initialize class org.apache.tika.utils.XMLReaderUtils at org.apache.tika.detect.XmlRootExtractor.extractRootElement(XmlRootExtractor.java:74) at org.apache.tika.detect.XmlRootExtractor.extractRootElement(XmlRootExtractor.java:47) at org.apache.tika.mime.MimeTypes.getMimeType(MimeTypes.java:212) at org.apache.tika.mime.MimeTypes.detect(MimeTypes.java:493) at org.apache.tika.detect.CompositeDetector.detect(CompositeDetector.java:84) at org.apache.tika.Tika.detect(Tika.java:156) at lucee.commons.io.IOUtil.getMimeType(IOUtil.java:1239) at lucee.commons.io.res.util.ResourceUtil.getMimeType(ResourceUtil.java:851) at lucee.runtime.tag.FileTag._actionUpload(FileTag.java:968) at lucee.runtime.tag.FileTag.actionUpload(FileTag.java:891) at lucee.runtime.tag.FileTag.doStartTag(FileTag.java:440) at com.trike.controller.trike_cfc$cf.udfCall4(/coyote/com/trike/controller/trike.cfc:1022) at com.trike.controller.trike_cfc$cf.udfCall(/coyote/com/trike/controller/trike.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:356) at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:213) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:702) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:589) at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:2007) at lucee.runtime.tag.Invoke.doComponent(Invoke.java:212) at lucee.runtime.tag.Invoke.doEndTag(Invoke.java:186) at com.requesthandler_cfc$cf.udfCall(/coyote/com/requestHandler.cfc:327) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:356) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:223) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:701) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:589) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1993) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:787) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1998) at includes.application.onrequestend_cfm$cf.call(/coyote/includes/Application/onRequestEnd.cfm:23) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1059) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:951) at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:932) at application_cfc$cf.udfCall(/Application.cfc:59) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:356) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:223) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:701) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:589) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1993) at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:445) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:231) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2715) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2701) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2672) at lucee.runtime.engine.Request.exe(Request.java:45) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1259) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1205) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97) at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51) at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at jdk.internal.reflect.GeneratedMethodAccessor591.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:134) at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doNext(FusionReactorRequestHandler.java:698) at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doHttpServletRequest(FusionReactorRequestHandler.java:256) at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doFusionRequest(FusionReactorRequestHandler.java:119) at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.handle(FusionReactorRequestHandler.java:736) at com.intergral.fusionreactor.j2ee.filter.FusionReactorCoreFilter.doFilter(FusionReactorCoreFilter.java:36) at jdk.internal.reflect.GeneratedMethodAccessor590.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:71) at jdk.internal.reflect.GeneratedMethodAccessor589.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at com.intergral.fusionreactor.agent.filter.FusionReactorStaticFilter.doFilter(FusionReactorStaticFilter.java:54) at com.intergral.fusionreactor.agent.pointcuts.NewFilterChainPointCut$1.invoke(NewFilterChainPointCut.java:50) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:346) at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:424) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)

It looks to me like it’s either misidentifying the MIME type of the file or it’s just falling over instantiating getMimeTypes(), or the tika object itself.

I can’t keep restarting Lucee… I was wondering if there was an alternate to CFFILE, but suspect there’s not short of writing something in Java.

I also don’t think I can update tika because it’s a lucee package, and therefore might’ve been altered.

(Ignore the bit about Application.cfc above - I was restricting upload mime types, but I’m not now!)

Argh!

  • Mike

hmm, is it hard to repo, or it just kinda randomly happens after a while?

As a first step, upgrading to the latest stable release, then if the problem still repos, we will obviously address it.

I seem to remember there was a tmp xml class being written out which we addressed at some point recently, I can’t find the ticket