我刚刚链接了YaHP converter,将我的velocity模板转换为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>
在我的项目中,我没有在任何地方使用过这个类,我也不知道应该在哪里添加什么样的依赖关系。
这是两个令人沮丧的小时,试图谷歌每一个可能的解决方案,但都徒劳无功!
我不知道这还需要什么。请给我建议一个解决方案
编辑
这是我的堆栈跟踪:
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]