seedstack - 运行 Seedstack 应用程序时出现异常
问题描述
我使用了 Hibernate 和 JPA 的种子堆栈依赖项来创建对数据库执行 crud 操作的 DAO 服务。我正在尝试通过 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 依赖项解决,所以我应该在哪里进行更改以解决错误。
提前致谢!
解决方案
通过阅读堆栈跟踪,您似乎在启动时遇到了一些由该handleException()
方法处理的错误。然后,此方法尝试编写 YAML 诊断报告,但最终由于您提到的 snakeyaml 版本问题而失败。
你应该做两件事:
- 通过查看依赖关系树来修复 snakeyaml 依赖关系问题。此类问题通常是由于某些库导致 Maven 选择了旧版本。SeedStack 至少需要
jackson-dataformat-yaml
2.9.4 版本,而后者又需要至少snakeyaml
1.18。 - 通过查看完整的堆栈跟踪来修复另一个错误。当无法写入诊断报告时,原始异常仍会打印在控制台上(在 stderr 上)。
推荐阅读
- scala - 使用 kafka 模式注册表时我真的需要 avro4s 吗?
- node.js - 在 VS Code / Javascript with Node 中调试时看不到任何变量、调用堆栈
- python.net - 当 Python 新版本 3.X 发布时,是否总是需要 Python.Net 开发团队发布新版本的 Python.Net?
- wordpress - 如何在仪表板页面的 Ninja Forms 中添加自定义表单模板?
- python - 绘图:qcut 然后 groupby 两个变量
- openrowset - Openrowset 持续运行
- entity-framework-6 - EF6 努力:播种数据会导致错误的 ID
- python - 需要让str方法返回字符串而不是打印
- asp.net - 每次 COM 组件,构造函数字符串更新都需要在 VB 中吗?当 COM 组件部署在 windows server 中时
- c++ - C plus plus 预期的不合格 id