Error running ‘XXXX’: Command line is too long. Shorten command line for XXXX:
1.打开本项目的.idea文件夹,找到文件夹中的workspace.xml文件
2.搜索 PropertiesComponent
3.在这个结构中添加<property name="dynamic.classpath" value="true" />
SpringBoot 启动时报错:Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
看到一种情况是因为排除了tomcat的starter
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!--<exclusions>-->
<!--<exclusion>-->
<!--<groupId>org.springframework.boot</groupId>-->
<!--<artifactId>spring-boot-starter-tomcat</artifactId>-->
<!--</exclusion>-->
<!--</exclusions>-->
</dependency>
我遇到的情况是
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided<scope/>
<dependency/>
provided 明了dependency 由JDK或者容器提供。例如如果开发了一个web 应用,可能在编译 classpath 中需要可用的Servlet API 来编译一个servlet,但是你不会想要在打包好的WAR 中包含这个Servlet API;这Servlet API JAR 由你的应用服务器或者servlet容器提供。已提供范围的依赖在编译classpath (不是运行时)可用。它们不是传递性的也不会被打包。
删除<scope>
标签恢复正常。