Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean
?protected EmbeddedServletContainerFactory getEmbeddedServletContainerFactory() {
??String[] beanNames = getBeanFactory().getBeanNamesForType(EmbeddedServletContainerFactory.class);
??System.out.println(getBeanFactory().getClass().getName());
??System.out.println(beanNames.length);
??if (beanNames.length == 0) {
???return null;
??}
??if (beanNames.length == 0) {
???throw new ApplicationContextException("Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.");
??}
??if (beanNames.length > 1) {
???throw new ApplicationContextException("Unable to start EmbeddedWebApplicationContext due to multiple EmbeddedServletContainerFactory beans : " + StringUtils.arrayToCommaDelimitedString(beanNames));
??}
??return (EmbeddedServletContainerFactory) getBeanFactory().getBean(beanNames[0], EmbeddedServletContainerFactory.class);
?}
我調(diào)式源碼發(fā)現(xiàn)
[2017-02-25 20:42:23.864] - 7444 信息 [main] --- com.imooc.GirlApplication: Starting GirlApplication on DESKTOP-JDE5DT4 with PID 7444 (E:\workspace\girl\web\WEB-INF\classes started by javacar in E:\workspace\girl)
[2017-02-25 20:42:23.883] - 7444 信息 [main] --- com.imooc.GirlApplication: No active profile set, falling back to default profiles: default
[2017-02-25 20:42:24.013] - 7444 信息 [main] --- org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext: Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@7fac631b: startup date [Sat Feb 25 20:42:24 CST 2017]; root of context hierarchy
[2017-02-25 20:42:24.813] - 7444 信息 [main] --- org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor: JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
org.springframework.beans.factory.support.DefaultListableBeanFactory
0
[2017-02-25 20:42:25.437] - 7444 信息 [main] --- org.springframework.jmx.export.annotation.AnnotationMBeanExporter: Registering beans for JMX exposure on startup
[2017-02-25 20:42:25.458] - 7444 信息 [main] --- com.imooc.GirlApplication: Started GirlApplication in 2.085 seconds (JVM running for 2.503)
這如何解決,缺什么jar。缺什么配置文件
2017-03-11
放完整代碼吧