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

Open Liberty首次启动正常,二次启动应用失败问题求助

Open Liberty二次启动失败问题分析

问题描述

使用liberty-maven-plugin v3.7.1执行mvn liberty:dev命令启动应用:

  • 首次启动时wlp目录无服务器实例,启动正常;
  • 停止服务器后再次启动失败,删除C:\dev\wlp\usr\servers\localServer目录可恢复首次启动,但二次启动仍报错。

异常信息

[DEBUG] (org.codehaus.mojo.pluginsupport.ant.AntHelper) CWWKM2014I: Now looking for CWWKZ0001I.*app in messages.log.
    Caused by: org.apache.maven.plugin.MojoExecutionException: CWWKM2187E: Failed to deploy the app application. The application start message was not found in the log file.
        at io.openliberty.tools.maven.applications.DeployMojoSupport.verifyAppStarted(DeployMojoSupport.java:221)
        at io.openliberty.tools.maven.applications.DeployMojo.installAndVerifyApp(DeployMojo.java:220)
        at io.openliberty.tools.maven.applications.DeployMojo.installLooseApplication(DeployMojo.java:189)
        at io.openliberty.tools.maven.applications.DeployMojo.installProject(DeployMojo.java:167)
        at io.openliberty.tools.maven.applications.DeployMojo.doExecute(DeployMojo.java:81)
        at org.codehaus.mojo.pluginsupport.MojoSupport.execute(MojoSupport.java:122)
        
        
        
        [DEBUG] action.exception.stacktrace: com.ibm.ws.install.InstallException: CWWKF1250I: The following assets already exist: [javaee-8.0, localConnector-1.0, monitor-1.0, restConnector-2.0]. They will not be reinstalled. To modify an existing feature, you must manually uninstall it first.
        at com.ibm.ws.install.internal.ExceptionUtils.create(ExceptionUtils.java:127)
        at com.ibm.ws.install.internal.ExceptionUtils.createByKey(ExceptionUtils.java:116)
        at com.ibm.ws.install.internal.InstallKernelMap.singleFileResolve(InstallKernelMap.java:935)
        at com.ibm.ws.install.internal.InstallKernelMap.get(InstallKernelMap.java:299)
        at com.ibm.ws.install.map.InstallMap.get(InstallMap.java:273)
        at io.openliberty.tools.common.plugins.util.InstallFeatureUtil.installFeatures(InstallFeatureUtil.java:451)
        at io.openliberty.tools.maven.server.InstallFeatureMojo.installFeatures(InstallFeatureMojo.java:62)

pom.xml配置

<plugin>
    <groupId>io.openliberty.tools</groupId>
    <artifactId>liberty-maven-plugin</artifactId>
    <version>3.7.1</version>
    <configuration>
        <installDirectory>C:\dev\wlp</installDirectory>
    </configuration>
    <!-- Specify configuration, executions for liberty-maven-plugin -->
</plugin>

问题原因

  • 特性安装冲突:二次启动时插件尝试重复安装已存在的特性(javaee-8.0等),虽然日志提示不会重装,但该异常会中断插件后续流程,导致应用部署验证步骤无法正常完成。
  • 应用启动验证逻辑异常:由于特性安装阶段的异常干扰,插件未正确捕获到应用启动成功的日志CWWKZ0001I,从而抛出部署失败的错误。
  • localServer目录残留状态:首次启动生成的localServer目录中保存了已安装特性的状态信息,二次启动时插件读取该状态后仍执行特性安装流程,引发冲突。

解决方案

  • 配置插件跳过特性重复安装:在pom.xml的liberty-maven-plugin配置中添加<skipInstallFeatures>true</skipInstallFeatures>,避免二次启动时重复执行特性安装操作:
    <plugin>
        <groupId>io.openliberty.tools</groupId>
        <artifactId>liberty-maven-plugin</artifactId>
        <version>3.7.1</version>
        <configuration>
            <installDirectory>C:\dev\wlp</installDirectory>
            <skipInstallFeatures>true</skipInstallFeatures>
        </configuration>
    </plugin>
    
  • 升级插件版本:liberty-maven-plugin 3.7.1存在该特性安装冲突的已知问题,升级到更高版本(如3.8.0及以上)可修复此逻辑缺陷。
  • 清理服务器状态缓存:若不想修改配置,可在二次启动前执行mvn liberty:clean命令清理localServer目录的残留状态,替代手动删除目录的操作。

内容的提问来源于stack exchange,提问作者Mr Smith

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.30 06:27:35