0

I have upgraded snakeyaml library from 1.33 to 2.0 and I see the below error:

Stacktrace was: java.lang.NoSuchMethodError: org.yaml.snakeyaml.parser.ParserImpl.(Lorg/yaml/snakeyaml/reader/StreamReader;)V at com.fasterxml.jackson.dataformat.yaml.YAMLParser.(YAMLParser.java:191) at com.fasterxml.jackson.dataformat.yaml.YAMLFactory._createParser(YAMLFactory.java:509) at com.fasterxml.jackson.dataformat.yaml.YAMLFactory.createParser(YAMLFactory.java:413) at com.fasterxml.jackson.dataformat.yaml.YAMLFactory.createParser(YAMLFactory.java:386) at com.fasterxml.jackson.dataformat.yaml.YAMLFactory.createParser(YAMLFactory.java:15) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3677) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3645) at com.nokia.cb.nfvo.dsl.tosca.WorkflowDefinition.(WorkflowDefinition.java:30) at com.nokia.cb.nfvo.dsl.tosca.InterfaceOperationsValidator.ensureWorkflowDefinitionCached(InterfaceOperationsValidator.java:187) at com.nokia.cb.nfvo.dsl.tosca.InterfaceOperationsValidator.validateInterfaceOperation(InterfaceOperationsValidator.java:160) at com.nokia.cb.nfvo.dsl.tosca.InterfaceOperationsValidator.validateInterfaceOperations(InterfaceOperationsValidator.java:143) at com.nokia.cb.nfvo.dsl.tosca.InterfaceOperationsValidator.validateInterfaceOperations(InterfaceOperationsValidator.java:106) at com.nokia.cb.nfvo.dsl.tosca.InterfaceOperationsValidator.validate(InterfaceOperationsValidator.java:77) at com.nokia.cb.nfvo.dsl.tosca.ToscaDslParserImpl.validate(ToscaDslParserImpl.java:142) at com.nokia.cb.nfvo.impl.ToscaDslParserImplTest.validateCsarFromDir(ToscaDslParserImplTest.java:1889) at com.nokia.cb.nfvo.impl.ToscaDslParserImplTest.validateCsarFromDir(ToscaDslParserImplTest.java:1883) at com.nokia.cb.nfvo.impl.ToscaDslParserImplTest.unknownOutputFromOperationInputsInterfaceOperations(ToscaDslParserImplTest.java:929) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:239) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:364) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:272) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:237) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:158) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:428) at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:562) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:548)

I have tried upgrading jackson after referring some link but I actually wanted to understand why is this issue?

  • 1
    that methods was `@deprecated` and probably removed - the javadoc of 1.33 mentions "use options" - from the release notes 2.0: "*Remove many deprecated methods (**Backwards-incompatible**)*" – user16320675 Apr 19 '23 at 10:58
  • When updating libraries I suggest to read the changelogs. Especially when the first version number changes (1.x -> 2.x). You can find the changelogs for snakeyaml: https://bitbucket.org/snakeyaml/snakeyaml/wiki/Changes As stated by user16320675 this contains the information about backwards-incompatibility. You have to check which Jackson version works with SnakeYaml 2.0 – TomStroemer Apr 19 '23 at 11:06
  • You need to use a version of SnakeYAML which is actually compatible with the version expected by Jackson. – Mark Rotteveel Apr 19 '23 at 12:19
  • Spring Boot released version 2.7.10 to support SnakeYAML 2.0 besides older versions. Perhaps an update of your dependencies will help. If not you have to accept that you can't update SnakeYAML yet. – Rob Spoor Apr 19 '23 at 12:28

0 Answers0