Problems accessing fresh deploy of SpringBoot sample app on Weblogic12C

假装没事ソ 提交于 2019-12-03 04:16:51

The problem with Weblogic is that it looks for a class that directly implements WebApplicationInitializer to load the context. You probably extend SpringBootServletInitializer. Try to create a class that implemets WebApplicationInitializer and copy the content of SpringBootServletInitializer in it(you will need to also copy one package level class from the spring source, so your custom class can see it, as far as I remember).

The soluation by Evgeni works thanks. But i have an improvement.

Rather than take a copy of the SpringBootServletInitializer and ErrorPageFilter, you can continue to extend it, but simply add a redundant "implements WebApplicationInitializer" to your class:

@Configuration
@EnableJpaRepositories
@EnableAutoConfiguration
@ComponentScan("nz.co.myapp")
public class Application extends SpringBootServletInitializer implements WebApplicationInitializer {

    /** Used for running in war */
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Application.class);
    }

}

Redundant superinterface WebApplicationInitializer for the type Application, already defined by SpringBootServletInitializer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!