Caused by: org.springframework.context.ApplicationContextException: Unable to start ServletWebServer


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.3.RELEASE)

2018-07-18 21:01:33.878  INFO 9132 --- [           main] com.wdg.main.Application                 : Starting Application on DESKTOP-UTMP3I9 with PID 9132 (D:\SpringTest\MySpringBoot\target\classes started by Administrator in D:\SpringTest\MySpringBoot)
2018-07-18 21:01:33.884  INFO 9132 --- [           main] com.wdg.main.Application                 : No active profile set, falling back to default profiles: default
2018-07-18 21:01:33.908  INFO 9132 --- [           main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@34b9f960: startup date [Wed Jul 18 21:01:33 CST 2018]; root of context hierarchy
2018-07-18 21:01:34.001  WARN 9132 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
2018-07-18 21:01:34.013 ERROR 9132 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:155) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at com.wdg.main.Application.main(Application.java:9) [classes/:na]
Caused by: org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getWebServerFactory(ServletWebServerApplicationContext.java:204) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:178) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:152) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	... 8 common frames omitted

最近在做SpringBoot发现的是在运行项目的时候出现了这样的问题

在网上查找了半天发现是jar包的问题,,可能是因为之前我的仓库中有很多的jar导致了冲突

于是我不得不将原来的然后重新启动项目发现问题是可以解决了

那么我的pom文件:


	4.0.0
	com.wdg.boot
	MySpringBoot
	0.0.1-SNAPSHOT
	
		
			org.springframework.boot
			spring-boot-starter-web
			2.0.3.RELEASE
		
		
			org.springframework.boot
			spring-boot
			2.0.3.RELEASE
		
		
		
			org.springframework.boot
			spring-boot-starter-thymeleaf
			2.0.3.RELEASE
		
	

出现这样的问题我认为是jar冲突,

希望对你有所帮助

你可能感兴趣的:(java)