Getting org.xml.sax.SAXParseException: Premature end of file suddenly on Fuse
Issue
- No recent changes has happened to bundles
- You begin to see this a exception similar to the following one on Fuse logs
2021-12-07 09:17:15,906 | ERROR | ExtenderThread-1 | ContextLoaderListener | 210 - org.springframework.osgi.extender - 1.2.1 | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=nnnn.nnnn, config=osgibundle:/META-INF/spring/*.xml))
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line -1 in XML document from URL [bundle://314.0:0/META-INF/spring/context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Premature end of file.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:397)[203:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)[203:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)[203:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)[203:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)[203:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)[203:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:164)[209:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:136)[209:org.springframework.osgi.core:1.2.1]
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)[205:org.apache.servicemix.bundles.spring-context:3.2.18.RELEASE_1]
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:545)[205:org.apache.servicemix.bundles.spring-context:3.2.18.RELEASE_1]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:69)[209:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)[209:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[209:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)[209:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:214)[210:org.springframework.osgi.extender:1.2.1]
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169)[210:org.springframework.osgi.extender:1.2.1]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)[209:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:716)[210:org.springframework.osgi.extender:1.2.1]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
Caused by: org.xml.sax.SAXParseException: Premature end of file.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)[:]
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)[:]
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)[:2.12.0]
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)[:2.12.0]
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)[:2.12.0]
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)[:2.12.0]
at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)[:]
at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)[:]
at org.apache.xerces.impl.xs.opti.SchemaDOMParser.parse(Unknown Source)[:]
at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)[:]
at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)[:]
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)[:]
at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)[:]
at org.apache.xerces.impl.xs.XMLSchemaValidator.getGlobalElementDecl(Unknown Source)[:]
at org.apache.xerces.impl.xs.SubstitutionGroupHandler.getMatchingElemDecl(Unknown Source)[:]
at org.apache.xerces.impl.xs.models.XSDFACM.oneTransition(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)[:2.12.0]
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)[:2.12.0]
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)[:2.12.0]
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 org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)[203:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:389)[203:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
... 18 more
Environment
- Fuse 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.