Spring boot 使用weblogic启动spring启动web应用程序时出错

Spring boot 使用weblogic启动spring启动web应用程序时出错,spring-boot,weblogic12c,Spring Boot,Weblogic12c,通过单击包含main方法的文件启动spring boot as java应用程序,下面是我得到的错误,配置了weblogic server,应用程序类型为war,即使我更改为jar,也会出现相同的异常 org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.Applicat

通过单击包含main方法的文件启动spring boot as java应用程序,下面是我得到的错误,配置了weblogic server,应用程序类型为war,即使我更改为jar,也会出现相同的异常

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:137) ~[spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
如何为weblogic服务器配置EmbeddedServletContainerFactoryBean我不知道有谁能帮我。。。。谢谢

下面是我的主课

@Configuration
@EnableWebMvc
@EnableJpaRepositories(basePackages = {"com.example.demo.repository"})
@EntityScan(basePackages = {"com.example.demo.entity"})
@PropertySource({"classpath:application.properties"})
@SpringBootApplication
@ComponentScan(basePackages={"com.example.demo"})
@EnableAutoConfiguration(exclude = {

org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class,
org.springframework.boot.actuate.autoconfigure.ManagementWebSecurityAutoConfiguration.class})


public class DemoApplication  extends SpringBootServletInitializer implements WebApplicationInitializer{

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    @Override
       protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
          return builder.sources(DemoApplication.class);
       }


}
我已经排除了pom.xml中的所有tomcat jar

2017-07-26 20:36:58.350 ERROR 1600 --- [  restartedMain] o.s.boot.SpringApplication               : Application startup failed

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:137) ~[spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at com.example.demo.DemoApplication.main(DemoApplication.java:36) [classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-1.5.4.RELEASE.jar:1.5.4.RELEASE]
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:189) ~[spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:162) ~[spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) ~[spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    ... 13 common frames omitted

请添加完整的堆栈跟踪。同时删除
@EnableWebMvc
@Configuration
(spring boot为您完成所有这些),这也适用于
@PropertySource
spring boot已经为您加载了该文件。如果您的
DemoApplication
类位于
com.example.demo
包中(建议您也删除所有其他注释,只保留
@springbootplication
@M Deinum,感谢您更新了完整堆栈跟踪。请添加完整堆栈跟踪。同时删除
@EnableWebMvc
@Configuration
(springboot为您完成所有这些),这也适用于
@PropertySource
spring boot已为您加载该文件。如果
DemoApplication
类位于
com.example.demo
包中(建议您删除所有其他注释,只保留
@SpringBootApplication
@M Deinum,感谢您更新了完整的stacktrace