我使用Hibernate和JPA的种子堆栈依赖关系来创建DAO服务,在数据库上执行crud操作。我正在尝试通过SeedMain类通过eclipse中的启动这个Seed堆栈应用程序模块。
In pom.xml - dependecy for undertow is given.
<dependency>
<groupId>org.seedstack.seed</groupId>
<artifactId>seed-web-undertow</artifactId>
</dependency>
When executing the SeedMain class, I am getting the below error snakeyaml error:-
Exception in thread "main" java.lang.NoSuchMethodError: org.yaml.snakeyaml.DumperOptions.setSplitLines(Z)V
at com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.buildDumperOptions(YAMLGenerator.java:259)
at com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.<init>(YAMLGenerator.java:232)
at com.fasterxml.jackson.dataformat.yaml.YAMLFactory._createGenerator(YAMLFactory.java:447)
at com.fasterxml.jackson.dataformat.yaml.YAMLFactory.createGenerator(YAMLFactory.java:397)
at org.seedstack.seed.core.internal.diagnostic.DefaultDiagnosticReporter.writeDiagnosticReport(DefaultDiagnosticReporter.java:75)
at org.seedstack.seed.core.internal.diagnostic.DefaultDiagnosticReporter.writeDiagnosticReport(DefaultDiagnosticReporter.java:67)
at org.seedstack.seed.core.internal.diagnostic.DiagnosticManagerImpl.dumpDiagnosticReport(DiagnosticManagerImpl.java:70)
at org.seedstack.seed.core.SeedMain.handleException(SeedMain.java:68)
at org.seedstack.seed.core.SeedMain.main(SeedMain.java:61)根据我的理解,错误是由于snakeyaml的某些版本不一致造成的,但是对于Seed堆栈,因为依赖项的版本是通过种子堆栈-bom依赖来解决的,所以我应该在哪里进行更改来解决错误。
提前谢谢!
发布于 2018-11-07 13:42:18
从读取堆栈跟踪来看,您似乎在启动时出现了一些错误,由handleException()方法处理。然后,此方法尝试编写YAML诊断报告,但由于您提到的snakeyaml版本问题,最终失败了。
你应该做两件事:
jackson-dataformat-yaml,而这又至少需要snakeyaml 1.18。https://stackoverflow.com/questions/53008040
复制相似问题