org.xml.sax.SAXParseException:src-import.0:阅读导入模式文档"null"失败 解决方案

本文提供了解决Spring加载时抛出的SAX解析异常的方法,通过更新xercesImpl.jar文件来解决导入模式文档读取失败的问题。
Spring加载时抛了这样一个错:
org.xml.sax.SAXParseException:src-import.0:阅读导入模式文档"null"失败 解决方案

解决方案也不难,更新xercesImpl.jar,貌似在Spring官方下载的那个xercesImpl.jar有点老了。

这里提供一个新点的xercesImpl.jar, 只针对Spring3。
fr.opensagres.poi.xwpf.converter.core.XWPFConverterException: org.apache.xmlbeans.XmlException: error: Unexpected end of file after null at fr.opensagres.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:71) at fr.opensagres.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:39) at fr.opensagres.poi.xwpf.converter.core.AbstractXWPFConverter.convert(AbstractXWPFConverter.java:46) at com.qdwk.DocxToPdfConverter.convertWordToPdfInChunks(DocxToPdfConverter.java:160) at com.qdwk.DocxToPdfConverter.main(DocxToPdfConverter.java:129) Caused by: org.apache.xmlbeans.XmlException: error: Unexpected end of file after null at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3511) at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1277) at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1264) at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:345) at org.openxmlformats.schemas.wordprocessingml.x2006.main.StylesDocument$Factory.parse(Unknown Source) at org.apache.poi.xwpf.usermodel.XWPFDocument.getStyle(XWPFDocument.java:464) at fr.opensagres.poi.xwpf.converter.core.styles.XWPFStylesDocument.<init>(XWPFStylesDocument.java:194) at fr.opensagres.poi.xwpf.converter.core.styles.XWPFStylesDocument.<init>(XWPFStylesDocument.java:188) at fr.opensagres.poi.xwpf.converter.core.XWPFDocumentVisitor.createStylesDocument(XWPFDocumentVisitor.java:151) at fr.opensagres.poi.xwpf.converter.core.XWPFDocumentVisitor.<init>(XWPFDocumentVisitor.java:144) at fr.opensagres.poi.xwpf.converter.pdf.internal.PdfMapper.<init>(PdfMapper.java:138) at fr.opensagres.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:56) ... 4 more Caused by: org.xml.sax.SAXParseException; systemId: file:; lineNumber: 1; columnNumber: 1; Unexpected end of file after null at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.reportFatalError(Piccolo.java:1038) at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.parse(Piccolo.java:723) at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3479) ... 15 more 现在出现这样的问题
最新发布
10-10
异常分析:11:07:40.137 [main] DEBUG org.apache.cxf.common.logging.LogUtils - Using org.apache.cxf.common.logging.Slf4jLogger for logging. 11:07:40.294 [main] DEBUG org.apache.cxf.endpoint.dynamic.DynamicClientFactory - Creating client from WSDL https://znwc.cnooc/xcoa/services/WsOaSystemService?wsdl 11:07:40.368 [main] DEBUG org.apache.cxf.resource.DefaultResourceManager - resolving resource <org.apache.cxf.wsdl11.WSDLManagerImpl/bus> type <interface org.apache.cxf.Bus> 11:07:40.369 [main] DEBUG org.apache.cxf.resource.DefaultResourceManager - resolving resource <null> type <interface org.apache.cxf.Bus> 11:08:30.898 [main] DEBUG org.apache.cxf.transport.http.HTTPConduit - Conduit &#39;{http://cxf.apache.org}TransportURIResolver.http-conduit&#39; has been (re)configured for plain http. 11:08:30.908 [main] DEBUG org.apache.cxf.transport.http.HTTPConduit - No Trust Decider configured for Conduit &#39;{http://cxf.apache.org}TransportURIResolver.http-conduit&#39; 11:08:30.910 [main] DEBUG org.apache.cxf.transport.http.HTTPConduit - No Auth Supplier configured for Conduit &#39;{http://cxf.apache.org}TransportURIResolver.http-conduit&#39; 11:08:30.911 [main] DEBUG org.apache.cxf.transport.http.HTTPConduit - Conduit &#39;{http://cxf.apache.org}TransportURIResolver.http-conduit&#39; has been configured for plain http. 11:08:30.921 [main] DEBUG org.apache.cxf.transport.http.HTTPConduit - registering incoming observer: org.apache.cxf.transport.TransportURIResolver$1@34a97744 11:08:31.184 [main] DEBUG org.apache.cxf.transport.https.SSLUtils - The location of the key store has not been set via a system parameter or through configuration so the default value of C:\Users\smartdot/.keystore will be used. 11:08:31.188 [main] DEBUG org.apache.cxf.transport.https.SSLUtils - The key store password has not been set via a system property or through configuration, reading data from the keystore will fail. 11:08:31.191 [main] DEBUG org.apache.cxf.transport.https.SSLUtils - The key password has not been set via a system property or through configuration, reading data from the keystore will fail. 11:08:31.193 [main] DEBUG org.apache.cxf.transport.https.SSLUtils - The keystore type has not been set in configuration so the default value of JKS will be used. 11:08:31.598 [main] DEBUG org.apache.cxf.resource.DefaultResourceManager - resolving resource <C:\Users\smartdot/.keystore> as stream 11:08:31.693 [main] DEBUG org.apache.cxf.transport.https.SSLUtils - No default keystore C:\Users\smartdot/.keystore 11:08:31.696 [main] DEBUG org.apache.cxf.transport.https.SSLUtils - The location of the trust store has not been set via a system parameter or through configuration so the default value of null will be used. 11:08:31.698 [main] DEBUG org.apache.cxf.transport.https.SSLUtils - TRUST_STORE_PASSWORD_NOT_SET 11:08:31.700 [main] DEBUG org.apache.cxf.transport.https.SSLUtils - The trust store type has not been set in configuration so the default value of JKS will be used. 11:08:31.767 [main] DEBUG org.apache.cxf.transport.https.HttpsURLConnectionFactory - The cipher suites have been set to [TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]. 11:08:33.321 [main] DEBUG org.apache.cxf.transport.http.Headers - Accept: */* 11:08:33.322 [main] DEBUG org.apache.cxf.transport.http.HTTPConduit - No Trust Decider for Conduit &#39;{http://cxf.apache.org}TransportURIResolver.http-conduit&#39;. An affirmative Trust Decision is assumed. 11:10:47.826 [main] DEBUG org.apache.cxf.transport.http.HTTPConduit - Conduit &#39;{http://cxf.apache.org}TransportURIResolver.http-conduit&#39; has been (re)configured for plain http. 11:10:47.830 [main] DEBUG org.apache.cxf.transport.http.HTTPConduit - No Trust Decider configured for Conduit &#39;{http://cxf.apache.org}TransportURIResolver.http-conduit&#39; 11:10:47.832 [main] DEBUG org.apache.cxf.transport.http.HTTPConduit - No Auth Supplier configured for Conduit &#39;{http://cxf.apache.org}TransportURIResolver.http-conduit&#39; 11:10:47.834 [main] DEBUG org.apache.cxf.transport.http.HTTPConduit - Conduit &#39;{http://cxf.apache.org}TransportURIResolver.http-conduit&#39; has been configured for plain http. 11:10:47.836 [main] DEBUG org.apache.cxf.transport.http.HTTPConduit - registering incoming observer: org.apache.cxf.transport.TransportURIResolver$1@62d0ac62 11:10:47.841 [main] DEBUG org.apache.cxf.transport.http.Headers - Accept: */* 11:10:47.842 [main] DEBUG org.apache.cxf.transport.http.HTTPConduit - No Trust Decider for Conduit &#39;{http://cxf.apache.org}TransportURIResolver.http-conduit&#39;. An affirmative Trust Decision is assumed. [Fatal Error] WsOaSystemService?wsdl=WsOaSystemService.wsdl:6:3: The element type "hr" must be terminated by the matching end-tag "</hr>". [2025-07-16 11:12:00] 错误: 服务调用失败 异常类型: ServiceConstructionException 错误详情: [Ljava.lang.String;@55caeb35 完整堆栈追踪: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service. at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:76) at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:319) at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:245) at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:238) at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:192) at com.hd.xcoa.project.BasicAuthWebServiceClient.createSecureClient(BasicAuthWebServiceClient.java:94) at com.hd.xcoa.project.BasicAuthWebServiceClient.main(BasicAuthWebServiceClient.java:33) Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:import): faultCode=PARSER_ERROR: Problem parsing &#39;http://znwc.cnooc/xcoa/services/WsOaSystemService?wsdl=WsOaSystemService.wsdl&#39;.: org.xml.sax.SAXParseException: The element type "hr" must be terminated by the matching end-tag "</hr>". at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2198) at com.ibm.wsdl.xml.WSDLReaderImpl.parseImport(WSDLReaderImpl.java:435) at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:312) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2352) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2338) at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:255) at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:165) at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:74) ... 6 more Caused by: org.xml.sax.SAXParseExceptionpublicId: http://znwc.cnooc/xcoa/services/WsOaSystemService?wsdl=WsOaSystemService.wsdl; systemId: http://znwc.cnooc/xcoa/services/WsOaSystemService?wsdl=WsOaSystemService.wsdl; lineNumber: 6; columnNumber: 3; The element type "hr" must be terminated by the matching end-tag "</hr>". at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2188) ... 13 more
07-17
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值