I\'m new to Spring Boot and having with error while running my application. I\'m following a tutorial and I believe I\'m having proper parent and dependencies with POM, plea
You need to Tomcat Dependency and also extend your Application Class from extends SpringBootServletInitializer
@SpringBootApplication
public class App extend SpringBootServletInitializer
{
public static void main( String[] args )
{
SpringApplication.run(App.class, "hello");
}
}
For me, I just had to put a -X flag with mvn
. Look at the debug log; there was an issue with Spring while locating the .properties file.
If you are running on a linux environment, basically your app does not have rights for the default port.
Try 8181 by giving the following option on VM.
-Dserver.port=8181
Try to change the port number in application.yaml
(or application.properties
) to something else.
For me, the problem was in XML migrations. I deleted all tables and sequences and it works on next bootRun
You need to add the tomcat dependency in your pom
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>