Getting "unable to resolve class" error message

Issue #469 invalid
Full name created an issue

Using: Java 8, version 1.25 of SnakeYAML

I’m getting the following error message after updating my gradle build file to use SnakeYAML:

Could not compile build file 'C:\…\build.gradle'.

startup failed:
build file 'C:\…\build.gradle': 66: unable to resolve class org.yaml.snakeyaml.Yaml
@ line 66, column 13.
def cfg = new org.yaml.snakeyaml.Yaml().load( new File("application.yaml").newInputStream() )

Within the “dependencies” section of the build file, I have this:

compile 'org.yaml:snakeyaml:1.25'

and there’s also the following task, that tries to instantiate the ‘Yaml’ class:

task testMe( ){
  def cfg = new org.yaml.snakeyaml.Yaml().load( new File("application.yaml").newInputStream() )
  doLast {
    println "make "
    println "profile =  ${cfg.spring.profiles.active}"
    assert cfg.spring.profiles.active == "local"
  }
}

Comments (1)

  1. Andrey Somov
    1. check your classpath.
    2. check that YOUR version of JAR does have the class (the archive should not be broken)

    This is not issue for SnakeYAML

  2. Log in to comment