1

我刚刚链接了 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>

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

尝试用谷歌搜索所有可能的解决方案已经 2 令人沮丧的小时,但都是徒劳的!

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

编辑 这是我的堆栈跟踪:

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.access$300(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$1.next(ServiceLoader.java:480) ~[na:1.8.0_151]
at javax.xml.datatype.FactoryFinder$1.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]
4

1 回答 1

1

如果您检查YaHP pom.xml还有xml-apis包含javax.xml.datatype.DatatypeFactory您缺少的类的 jar

<dependency>
        <groupId>xml-apis</groupId>
        <artifactId>xml-apis</artifactId>
        <version>2.0.2</version>
    </dependency>
于 2018-02-21T11:01:21.053 回答