Domanda

inserito nella radice di classpath (SRC / Main / Risorse).

A application.properties File nello stesso posto è utilizzato correttamente.

Questo è il codice:

@Controller
@EnableAutoConfiguration
public class TestResource {

    @RequestMapping("/")
    public @ResponseBody Map<String, String> test() {
        return Collections.singletonMap("text", "test text");
    }

    public static void main(String[] args) {
        SpringApplication.run(TestResource.class, args);
    }

}
.

È stato utile?

Soluzione

È necessario aggiungere dipendenza da SnakeYAML.Esempio di dipendenza MAVEN:

<dependency>
    <groupId>org.yaml</groupId>
    <artifactId>snakeyaml</artifactId>
    <version>1.13</version>
</dependency>
.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top