jetty启动logback阻塞控制台空白或者抛出I/O error occurred while parsing xml file

解决办法很简单,把logback.xml的dtd注释掉。

Java程序在解析xml文件时,如果xml文件中指定了dtd,在默认会从指定的url下载dtd文件,但是很多情况下如果网络连接不上,或者防火墙原因,dtd文件无法下载下来导致程序报连接超时异常,解析xml失败。

我的就是因为这个dtd文档地址被墙了,折腾我好久。。。

xmlns,schema,dtd,我就不科普了

已标记关键词 清除标记
[code="java"] {modify=com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl@bb7465, add=com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl@d6c16c} org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '' is not a valid value for 'integer'. at com.sun.org.apache.xerces.internal.jaxp.validation.Util.toSAXParseException(Util.java:109) at com.sun.org.apache.xerces.internal.jaxp.validation.ErrorHandlerAdaptor.error(ErrorHandlerAdaptor.java:104) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:429) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3185) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidType(XMLSchemaValidator.java:3113) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processElementContent(XMLSchemaValidator.java:3025) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleEndElement(XMLSchemaValidator.java:2178) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:814) at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.endElement(ValidatorHandlerImpl.java:345) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(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.AbstractSAXParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.process(ValidatorImpl.java:192) at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:159) at javax.xml.validation.Validator.validate(Validator.java:82) at test.Config.valitorXML(Config.java:111) at test.Config.main(Config.java:136) [/code] 就是这里发出的错。 [code="java"] InputStream is = new FileInputStream(xml); Source source = new StreamSource(is); Validator validator = Config.getValidator("add"); validator.validate(source); [/code]
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页