SpringbootUnable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFact
2016-03-07 18:52
976 查看
本地Eclipse运行Spring boot程序的时候正常,打包放到服务器上之后运行出现了如下异常:
Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean. at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:140) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:476) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:124) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:658) at org.springframework.boot.SpringApplication.run(SpringApplication.java:355) at org.springframework.boot.SpringApplication.run(SpringApplication.java:920) at org.springframework.boot.SpringApplication.run(SpringApplication.java:909) at hu.kumite.Application.main(Application.java:17) Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean. at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:190) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:163) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137) ... 7 more
原因是在pom文件打包的语句不是用的spring boot打包的插件:
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <executions> <execution> <goals> <goal>repackage</goal> </goals> <configuration> <classifier>exec</classifier> </configuration> </execution> </executions> </plugin> </plugins> </build>
这么写就对了。
相关文章推荐
- webapp前端开发软键盘与position:fixed为我们带来的不便
- webApplicationContext 与servletContext
- SPRING IN ACTION 第4版笔记-第九章Securing web applications-001-SpringSecurity简介(DelegatingFilterProxy、AbstractSecurityWebApplicationInitializer、WebSecurityConfigurerAdapter、@EnableWebSecurity、@EnableWebMvcS)
- 解决maven搭建webapp项目,src/main/java无法建立的问题
- WebAPP输入框被软键盘遮挡肿么办?
- SPRING IN ACTION 第4版笔记-第七章Advanced Spring MVC-001- DispatcherServlet的高级配置(ServletRegistration.Dynamic、WebApplicationInitializer)
- 手机webapp meta标签 (全屏)
- webapp移动端适配方案之“手淘框架flexible”
- WebApplicationContext初始化
- 分享WEBAPP利用纯HTML5实现拨打电话,打开相册,打开摄像头源码
- WebAPP输入框被软键盘遮挡肿么办?
- 【JAVA调错】----JBoss发布多个项目时抛出webAppRootKey错误
- 手机APP有三类:原生APP,WebAPP,HybridApp
- webapp设计注意事项
- 嵌入式jetty9启动标准webapp目录
- 一步一步构建手机WebApp开发——环境搭建
- ionic创建应用的三个模版
- 响应式布局基础三:webapp布局
- 使用Intellij idea 创建maven项目 没有默认创建webapp相关目录
- 数据库连接不上,在项目启动时spring报错.No Spring WebApplicationInitializer types detected on classpath