简体   繁体   English

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

[英]Exception while running Seedstack Application

I have used seedstack dependecies for Hibernate and JPA to create DAO services that performs crud operations on Database. 我使用了Hibernate和JPA的种子堆栈依赖项来创建在数据库上执行Crud操作的DAO服务。 I am trying to Launch this Seedstack application module through Java application Launcher in eclipse, by SeedMain class. 我试图通过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)

As per my understanding the Error is due to some version inconsistency for snakeyaml , But for Seedstack as the versions for dependecies are resolved by seedstack-bom dependecy, so where exactly should I do the changes to resolve the error. 根据我的理解,错误是由于snakeyaml的某些版本不一致引起的 ,但是对于Seedstack来说,因为依赖项的版本是由seedstack-bom依赖项解决的,所以我应该在哪里进行更改以解决错误。

Thanks in Advance! 提前致谢!

From reading the stacktrace, it seems that you have some error on startup which is handled by the handleException() method. 通过阅读stacktrace,似乎您在启动时遇到了一些错误,该错误由handleException()方法处理。 This method then tries to write a YAML diagnostic report but ultimately fails due to the snakeyaml version issue you mentioned. 然后,此方法尝试编写YAML诊断报告,但由于您提到的snakeyaml版本问题而最终失败。

You should do two things: 您应该做两件事:

  • Fix the snakeyaml dependency issue by looking into the dependency tree. 通过查看依赖关系树来修复snakeyaml依赖关系问题。 This kind of problem is often caused by some library that makes Maven choose an older version. 此类问题通常是由某些使Maven选择较旧版本的库引起的。 SeedStack needs at least jackson-dataformat-yaml version 2.9.4 which in turn needs at least snakeyaml 1.18. SeedStack至少需要使用jackson-dataformat-yaml 2.9.4版本,而该版本至少需要使用snakeyaml 1.18。
  • Fix the other error by looking at the full stacktrace. 通过查看完整的堆栈跟踪来修复另一个错误。 When a diagnostic report cannot be written, the original exception is still printed on the console (on stderr). 当无法编写诊断报告时,原始异常仍会打印在控制台上(在stderr上)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM