SpringBoot - Unable to start embedded container
Annotating with the @SpringBootApplication resolves this issue.
@SpringBootApplication
@RestController
public class SpringBootLoginController {
@RequestMapping("/hello")
String hello() {
return "Hello World!!!";
}
public static void main(String[] args) throws Exception {
SpringApplication.run(SpringBootLoginController.class, args);
}
}
Alternatively , by Adding the @EnableAutoConfiguration , @ComponentScan and @Configuration also resolves this issue.
@EnableAutoConfiguration
@RestController
public class SpringBootLoginController {
@RequestMapping("/hello")
String hello() {
return "Hello World!!!";
}
public static void main(String[] args) throws Exception {
SpringApplication.run(SpringBootLoginController.class, args);
}
}
Spring framework unable to start embedded container
When using Spring Boot you should not include the other Spring dependencies directly, but rely on Boot's own dependency management. When using the provided "starters" you can be sure that all needed libraries will be included in a matching version.
Instead of including spring-mvc
artifact in your pom.xml:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
use the dedicated Boot starter for webapps, spring-boot-starter-web
:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
More details in the the official guide
I believe other parts of your pom.xml are superfluous as well (spring-boot-starter, javax.servlet-api, spring-boot-maven-plugin)
Spring Boot: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean
The scheduling guide isn't a web app so you probably have some mouldy stuff in your pom.xml from the REST guide? If you follow the instructions closely it should work. Another potential issue with the code you posted above is that your @EnableAutoConfiguration
class is not used in the context, only as a main method (which may not be a problem for the scheduling guide but it probably is for a bunch of others).
Spring boot: Unable to start embedded Tomcat servlet container
Try to change the port number in application.yaml
(or application.properties
) to something else.
Related Topics
How to Efficiently Return the Max Possible Integer With a Given Number of Digits
Why Is Git Bash Not Using the Correct Java Path as Defined in the Path Environment Variable
Beanutils Copyproperties API to Ignore Null and Specific Propertie
Java.Time.Format.Datetimeparseexception: Text Could Not Be Parsed At Index 3
Java.Lang.Noclassdeffounderror: Com/Fasterxml/Jackson/Databind/Exc/Invaliddefinitionexception
Adb Cannot Connect to Daemon At Tcp:5037
Generate Any Random Number of Any Length in Java
Simple Export and Import of a Sqlite Database on Android
How to Remove Duplicate and Sort Objects from Jsonarray Using Java
Spring Security Configuration Filter Any Requests Except a Specific Endpoint
How to Sort Json Object in Java
How to Change the Colors of Text and Background for Cmd in Java
How to Extract Ip Address in Spring MVC Controller Get Call
Get the Nearest Date to Specific from the List of Dates
How to Acknowledge Current Offset in Spring Kafka for Manual Commit