I just began to use spring boot. My new created project doesn´t work succesfully. I want to run the spring boot app with "run as Spring Boot App" but I´ve got the same error as @Vinay Vaishnav. I´ve tried everything covered in the replies.
My first error was: Failed to refresh live data from process ...
After that I included following dependency to the pom.xml:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
Because of the added dependency the error is gone but then i´ve got 404
I also added the livereload devtools in the applicationProperties. It doesn´t matter if this line is added or not.
That´s my code for now:
AppConfiguration.java:
package com.example.demo;
import org.springframework.web.bind.annotation.RequestMapping;
public class AppConfiguration {
@RequestMapping("/hello")
public String hello() {
return "Hello World";
}
}
applicationProperties:
spring.devtools.livereload.enabled=true
server.port=8081
HelloWorldApplication.java:
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RestController;
@RestController
@SpringBootApplication
public class HelloWorldApplication {
public static void main(String[] args) {
SpringApplication.run(HelloWorldApplication.class, args);
}
}
My versions:
- Apache Maven 3.6.3
- Spring Boot 2.2.6
- JDK 13.0.2
