小编Him*_*rma的帖子

Spring Boot 2.6.1 不支持 SAX 功能

Spring Boot 2.6.1 支持 logback 1.2.7

我在项目中添加了以下依赖项

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
        </dependency>
Run Code Online (Sandbox Code Playgroud)

但构建失败并出现以下异常:

Caused by: javax.xml.parsers.ParserConfigurationException: SAX feature 'http://xml.org/sax/features/external-general-entities' not supported.
    at oracle.xml.jaxp.JXSAXParserFactory.setFeature(JXSAXParserFactory.java:272)
    at ch.qos.logback.core.joran.event.SaxEventRecorder.buildSaxParser(SaxEventRecorder.java:82)
    ... 44 more
Run Code Online (Sandbox Code Playgroud)

在 SaxEventRecorder.class 中,构建 SAX 解析器时失败

Caused by: javax.xml.parsers.ParserConfigurationException: SAX feature 'http://xml.org/sax/features/external-general-entities' not supported.
    at oracle.xml.jaxp.JXSAXParserFactory.setFeature(JXSAXParserFactory.java:272)
    at ch.qos.logback.core.joran.event.SaxEventRecorder.buildSaxParser(SaxEventRecorder.java:82)
    ... 44 more
Run Code Online (Sandbox Code Playgroud)

有没有办法覆盖实施?

谢谢 :)

java spring sax logback spring-boot

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

java ×1

logback ×1

sax ×1

spring ×1

spring-boot ×1