Error after upgrading Snake YAML from 1.33 to 2.0

Issue #1072 invalid
Arvind Krishnakumar created an issue

I’m seeing the following runtime error after my recent upgrade from 1.33 to 2.0:

java.lang.NoSuchMethodError: org.yaml.snakeyaml.constructor.SafeConstructor: method 'void <init>()' not found

Can someone please assist?

P.S: I’m not using Spring in my project.

Comments (11)

  1. Andrey Somov

    Do you use any IDE ?

    SafeConstructor requires to have LoaderOptions in its constructor.

    (why Spring should anyhow affect how you create an instance of SafeConstructor?)

  2. Arvind Krishnakumar reporter

    I'm using SafeConstructor like this:

    Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()), new Representer(yamlOptions()));
    

  3. renxue he (Ralph)

    It look like you parse bean has not empty param constructor and the snakeyaml need it the parse by reflect

  4. Log in to comment