-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
If we follow the tutorial and generate a project using spring initializr, we get the following file:
src/main/java/com/example/demo/DemoApplication.java
:
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
However, the tutorial erroneously states that
The Spring Initializr creates an application class for you. In this case, you do not need to further modify the class. The following listing (from src/main/java/com/example/restservice/RestServiceApplication.java) shows the application class:
package com.example.restservice;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class RestServiceApplication {
public static void main(String[] args) {
SpringApplication.run(RestServiceApplication.class, args);
}
}
...but this file doesn't exist.
In order to complete the tutorial, I ended up having to remove the demo file and replace it with the rest service file. This process also ended up adding a bit of unwanted mental load to my first spring boot tutorial haha.
Let me know if there are any questions or if you'd like any help with this.