运行Seedstack应用程序时发生异常

时间:2018-10-26 11:46:28

标签: seedstack

我已经使用了Hibernate和JPA的种子堆栈依赖关系来创建DAO服务,该服务在数据库上执行Crud操作。     我试图通过SeedMain类通过Eclipse中的Java应用程序启动器启动该Seedstack应用程序模块。

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 的某些版本不一致导致的,但是对于Seedstack,因为依赖项的版本是由seedstack-bom依赖项解决的,所以我应该在哪里进行更改解决错误。

预先感谢!

1 个答案:

答案 0 :(得分:0)

通过阅读堆栈跟踪信息,您似乎在启动时遇到了一些错误,该错误由handleException()方法处理。然后,此方法尝试编写YAML诊断报告,但由于您提到的snakeyaml版本问题而最终失败。

您应该做两件事:

  • 通过查看依赖关系树来修复snakeyaml依赖关系问题。此类问题通常是由某些使Maven选择较旧版本的库引起的。 SeedStack至少需要jackson-dataformat-yaml版本2.9.4,而版本至少需要snakeyaml 1.18。
  • 通过查看完整的堆栈跟踪信息来修复另一个错误。当无法编写诊断报告时,原始异常仍会打印在控制台上(在stderr上)。
相关问题