YaHP 转换器抛出 javax.xml.datatype.DatatypeConfigurationException

YaHP Converter throws javax.xml.datatype.DatatypeConfigurationException

我刚刚链接了 YaHP 转换器以将我的速度模板转换为 PDF 格式。 当我打开 Swagger 到 运行 和 API 时,我得到的只是:

There was an unexpected error (type=Internal Server Error, status=500).
javax.xml.datatype.DatatypeConfigurationException: Provider for class javax.xml.datatype.DatatypeFactory cannot be found

这是我的 pom:

    <dependency>
        <groupId>com.google.code.maven-play-plugin.org.allcolor.yahp</groupId>
        <artifactId>yahp-internal</artifactId>
        <version>1.3</version>
    </dependency>
    <dependency>
        <groupId>org.xhtmlrenderer</groupId>
        <artifactId>core-renderer</artifactId>
        <version>R8pre2</version>
    </dependency>
    <dependency>
        <groupId>com.lowagie</groupId>
        <artifactId>itext</artifactId>
        <version>2.1.7</version>
    </dependency>
    <dependency>
        <groupId>jaxen</groupId>
        <artifactId>jaxen</artifactId>
        <version>1.1.1</version>
    </dependency>
    <dependency>
        <groupId>net.sf.jtidy</groupId>
        <artifactId>jtidy</artifactId>
        <version>r938</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.16</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.maven-play-plugin.org.allcolor.shanidom</groupId>
        <artifactId>shani-parser</artifactId>
        <version>1.4.17-patched-yahp-1.3</version>
    </dependency>
    <dependency>
        <groupId>xml-apis</groupId>
        <artifactId>xml-apis</artifactId>
        <version>2.0.2</version>
    </dependency>

我还没有在我的项目中的任何地方使用这个 class 并且我不知道在哪里添加什么样的依赖。

花了 2 个令人沮丧的小时尝试 google 每个可能的解决方案,但都是徒劳的!

我不知道这还有什么要求。请给我一个解决方案

编辑 这是我的堆栈跟踪:

java.util.ServiceConfigurationError: javax.xml.datatype.DatatypeFactory: Provider org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl not found
at java.util.ServiceLoader.fail(ServiceLoader.java:239) ~[na:1.8.0_151]
at java.util.ServiceLoader.access0(ServiceLoader.java:185) ~[na:1.8.0_151]
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372) ~[na:1.8.0_151]
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) ~[na:1.8.0_151]
at java.util.ServiceLoader.next(ServiceLoader.java:480) ~[na:1.8.0_151]
at javax.xml.datatype.FactoryFinder.run(FactoryFinder.java:297) ~[na:1.8.0_151]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_151]
at javax.xml.datatype.FactoryFinder.findServiceProvider(FactoryFinder.java:292) ~[na:1.8.0_151]
at javax.xml.datatype.FactoryFinder.find(FactoryFinder.java:268) ~[na:1.8.0_151]
at javax.xml.datatype.DatatypeFactory.newInstance(DatatypeFactory.java:145) ~[na:1.8.0_151]
at javax.xml.bind.DatatypeConverterImpl.<clinit>(DatatypeConverterImpl.java:890) ~[na:1.8.0_151]
at javax.xml.bind.DatatypeConverter.initConverter(DatatypeConverter.java:140) ~[na:1.8.0_151]
at javax.xml.bind.DatatypeConverter.parseBase64Binary(DatatypeConverter.java:341) ~[na:1.8.0_151]
at io.jsonwebtoken.impl.Base64Codec.decode(Base64Codec.java:29) ~[jjwt-0.2.jar:0.2]
at io.jsonwebtoken.impl.DefaultJwtParser.setSigningKey(DefaultJwtParser.java:61) ~[jjwt-0.2.jar:0.2]
at com.wazootix.security.JwtTokenUtil.getClaimsFromToken(JwtTokenUtil.java:94) ~[classes/:na]
at com.wazootix.security.JwtTokenUtil.getUsernameFromToken(JwtTokenUtil.java:50) ~[classes/:na]
at com.wazootix.security.JwtAuthFilter.doFilterInternal(JwtAuthFilter.java:38) ~[classes/:na]

如果您检查包含 javax.xml.datatype.DatatypeFactory class 的 YaHP pom.xml there's also xml-apis jar,则您丢失了

<dependency>
        <groupId>xml-apis</groupId>
        <artifactId>xml-apis</artifactId>
        <version>2.0.2</version>
    </dependency>