Invoking document(<url>) leads to IOException (Cannot determine DOCTYPE as it would destroy underlaying InputStream)

Description

Suddenly loading documents in xsl from external resources is resulting in an IOException:

java.io.IOException: javax.xml.transform.TransformerException: java.io.IOException: Cannot determine DOCTYPE as it would destroy underlaying InputStream.
at org.mycore.common.content.transformer.MCRXSLTransformer.transform(MCRXSLTransformer.java:245)
at org.mycore.common.xml.MCRLayoutService.transform(MCRLayoutService.java:190)
at org.mycore.common.xml.MCRLayoutService.doLayout(MCRLayoutService.java:88)
at org.mycore.mets.servlets.MCRMETSServlet.doGetPost(MCRMETSServlet.java:108)
at org.mycore.frontend.servlets.MCRServlet.doGet(MCRServlet.java:170)
at org.mycore.frontend.servlets.MCRServlet.render(MCRServlet.java:473)
at org.mycore.frontend.servlets.MCRServlet.processRenderingPhase(MCRServlet.java:439)
at org.mycore.frontend.servlets.MCRServlet.doGetPost(MCRServlet.java:289)
at org.mycore.frontend.servlets.MCRServlet.doGet(MCRServlet.java:143)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:649)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.mycore.frontend.filter.MCRUserAgentFilter.doFilter(MCRUserAgentFilter.java:67)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.mycore.frontend.filter.MCRCORSFilter.doFilter(MCRCORSFilter.java:85)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.mycore.frontend.filter.MCRWebAppBaseFilter.doFilter(MCRWebAppBaseFilter.java:41)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.mycore.frontend.filter.MCRRequestAuthenticationFilter.doFilter(MCRRequestAuthenticationFilter.java:57)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.mycore.frontend.filter.MCRRequestDebugFilter.doFilter(MCRRequestDebugFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:120)
at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:133)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:476)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: javax.xml.transform.TransformerException: java.io.IOException: Cannot determine DOCTYPE as it would destroy underlaying InputStream.
at org.apache.xpath.XPath.execute(XPath.java:365)
at org.apache.xalan.templates.ElemVariable.getValue(ElemVariable.java:280)
at org.apache.xalan.templates.ElemVariable.execute(ElemVariable.java:248)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.templates.ElemIf.execute(ElemIf.java:162)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2272)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1358)
at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3449)
at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:408)
at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.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.AbstractSAXParser.parse(Unknown Source)
at org.mycore.common.content.transformer.MCRXSLTransformer.transform(MCRXSLTransformer.java:238)
... 54 more
Caused by: org.mycore.common.MCRException: java.io.IOException: Cannot determine DOCTYPE as it would destroy underlaying InputStream.
at org.mycore.common.xml.MCRURIResolver$MCRRESTResolver.getResponse(MCRURIResolver.java:558)
at org.mycore.common.xml.MCRURIResolver$MCRCacheableURIResolver.resolve(MCRURIResolver.java:394)
at org.mycore.common.xml.MCRURIResolver.resolve(MCRURIResolver.java:264)
at org.apache.xpath.SourceTreeManager.resolveURI(SourceTreeManager.java:127)
at org.apache.xalan.templates.FuncDocument.getDoc(FuncDocument.java:237)
at org.apache.xalan.templates.FuncDocument.execute(FuncDocument.java:194)
at org.apache.xpath.XPath.execute(XPath.java:337)
... 93 more
Caused by: java.io.IOException: Cannot determine DOCTYPE as it would destroy underlaying InputStream.
at org.mycore.common.content.MCRContent.getDocType(MCRContent.java:302)
at org.mycore.common.content.MCRContent.getReusableCopy(MCRContent.java:338)
at org.mycore.common.xml.MCRURIResolver$MCRRESTResolver.getResponse(MCRURIResolver.java:553)

Environment

None

Assignee

Sebastian Hofmann

Reporter

Silvio Hermann

Labels

None

URL

None

External issue ID

None

Fix versions

Affects versions

Priority

High
Configure