You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Spring Boot WAR包部署WebSphere Liberty成功但无法启动问题

问题:Spring Boot WAR包部署到WebSphere Liberty后无法启动

我尝试通过IntelliJ IDEA的WebSphere/Liberty Server运行配置,将Spring Boot应用以WAR包形式部署并运行在WebSphere Liberty 23.0.0.9上。当前使用Java 11和Spring Boot 2.4.5版本,WAR包已成功构建并部署,但Spring Boot应用无法启动。该应用以独立Jar包在Spring Boot内嵌Tomcat上运行无异常,无法确定是Maven依赖、Spring配置还是server.xml中缺失了必要配置。

SpringBootApplication类代码

@SpringBootApplication(scanBasePackages = "main.package", exclude = { JmxAutoConfiguration.class })
@EntityScan(basePackages = "main.package.domain.model")
@EnableJpaRepositories(basePackages = "main.package.domain.repository")
public class Application extends SpringBootServletInitializer {

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

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Application.class);
    }

}

server.xml启用的特性

<featureManager>
    <feature>localConnector-1.0</feature>
    <feature>servlet-6.0</feature>
    <feature>pages-3.1</feature>
    <feature>xmlBinding-4.0</feature>
    <feature>persistence-3.1</feature>
    <feature>messagingClient-3.0</feature>
    <feature>messagingServer-3.0</feature>
    <feature>appSecurity-5.0</feature>
    <feature>restConnector-2.0</feature>
</featureManager>

maven-war-plugin配置

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>3.3.1</version>
    <executions>
        <execution>
            <goals>
                <goal>war</goal>
            </goals>
            <phase>package</phase>
            <configuration>
                <archive>
                    <manifestEntries>
                        <Implementation-Title>${project.name}</Implementation-Title>
                        <Implementation-Version>${project.version}</Implementation-Version>
                    </manifestEntries>
                </archive>
            </configuration>
        </execution>
    </executions>
</plugin>

部署日志

[AUDIT   ] CWWKT0016I: Web application available (default_host): http://172.23.196.86:9082/app/
[AUDIT   ] CWWKZ0001I: Application app started in 27,568 seconds.
[AUDIT   ] CWWKF0012I: The server installed the following features: [appSecurity-5.0, cdi-4.0, distributedMap-1.0, expressionLanguage-5.0, jdbc-4.2, jndi-1.0, json-1.0, jsonp-2.1, localConnector-1.0, messagingClient-3.0, messagingServer-3.0, pages-3.1, persistence-3.1, persistenceContainer-3.1, restConnector-2.0, servlet-6.0, ssl-1.0, transportSecurity-1.0, xmlBinding-4.0].
[AUDIT   ] CWWKF0011I: The localBusinessServer server is ready to run a smarter planet. The localBusinessServer server started in 37,433 seconds.
Connected to server
[2025-06-06 09:38:44,969] Artifact app:war: Artifact is being deployed, please wait...
[2025-06-06 09:38:44,987] Artifact app:war: Artifact is deployed successfully
[2025-06-06 09:38:44,987] Artifact app:war: Deploy took 18 milliseconds

日志说明:WAR已部署但应用未运行,无Spring Boot日志输出,Application.configure方法也未被调用。

内容的提问来源于stack exchange,提问作者Lyss P. Hacker

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 22:33:14