OpenLiberty / ci.maven

Maven plugins for managing Liberty profile servers #devops
Apache License 2.0
130 stars 91 forks source link

Intermittent install-feature failure when generating features #1550

Open turkeylurkey opened 2 years ago

turkeylurkey commented 2 years ago

When the server starts with no features and the app is not deployed then adding features can fail at times.

Start with the demo-devmode project and remove all features from server.xml. Erase generated-features.xml. Start dev mode with generateFeatures disabled. The server starts with no features and the app is not deployed. Type g and press Enter to generate features. Features should be generated and installed.

[INFO] Setting automatic generation of features to: [ On ]
[WARNING] The source configuration directory will be modified. Features will automatically be generated in a new file: /home/ibmadmin/demo-devmode/src/main/liberty/config/configDropins/overrides/generated-features.xml
[INFO] Running liberty:generate-features
[INFO] Generated the following features: [cdi-2.0, mpHealth-3.1, mpMetrics-3.0, jaxrs-2.1]

However, in some cases the install-features fails and when the app is started multiple error messages about missing features are generated by the server.

[INFO] [AUDIT   ] CWWKG0016I: Starting server configuration update.
[INFO] [AUDIT   ] CWWKG0093A: Processing configuration drop-ins resource: /home/ibmadmin/demo-devmode/target/liberty/wlp/usr/servers/defaultServer/configDropins/overrides/generated-features.xml
[INFO] [AUDIT   ] CWWKG0093A: Processing configuration drop-ins resource: /home/ibmadmin/demo-devmode/target/liberty/wlp/usr/servers/defaultServer/configDropins/overrides/liberty-plugin-variable-config.xml
[INFO] [ERROR   ] CWWKF0001E: A feature definition could not be found for mphealth-3.1
[INFO] [ERROR   ] CWWKF0001E: A feature definition could not be found for mpmetrics-3.0
[INFO] [ERROR   ] CWWKF0001E: A feature definition could not be found for cdi-2.0
[INFO] [ERROR   ] CWWKF0001E: A feature definition could not be found for jaxrs-2.1
[INFO] [AUDIT   ] CWWKG0017I: The server configuration was successfully updated in 0.056 seconds.

This can happen rarely on a Mac but it happens more readily on a Linux server with a 2 GHz processor. If you use the -X option it happens more often.

kathrynkodama commented 2 years ago

In the above install-feature fails with the following:

[ERROR] Failed to install features from configuration file
org.apache.maven.plugin.MojoExecutionException: Unable to execute mojo
    at org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo (MojoExecutor.java:122)
    at io.openliberty.tools.maven.server.StartDebugMojoSupport.runLibertyMojo (StartDebugMojoSupport.java:362)
    at io.openliberty.tools.maven.server.StartDebugMojoSupport.runLibertyMojoInstallFeature (StartDebugMojoSupport.java:347)
    at io.openliberty.tools.maven.server.DevMojo.runLibertyMojoInstallFeature (DevMojo.java:1888)
    at io.openliberty.tools.maven.server.DevMojo$DevMojoUtil.installFeatures (DevMojo.java:1017)
    at io.openliberty.tools.common.plugins.util.DevUtil.installFeaturesToTempDir (DevUtil.java:4559)
    at io.openliberty.tools.common.plugins.util.DevUtil.processConfigFileChange (DevUtil.java:4311)
    at io.openliberty.tools.common.plugins.util.DevUtil.processFileChanges (DevUtil.java:4167)
    at io.openliberty.tools.common.plugins.util.DevUtil.watchFiles (DevUtil.java:3131)
    at io.openliberty.tools.maven.server.DevMojo.doExecute (DevMojo.java:1417)
    at org.codehaus.mojo.pluginsupport.MojoSupport.execute (MojoSupport.java:122)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution null of goal io.openliberty.tools:liberty-maven-plugin:3.6.1-SNAPSHOT:install-feature failed: A required class was missing while executing io.openliberty.tools:liberty-maven-plugin:3.6.1-SNAPSHOT:install-feature: com/ibm/websphere/ras/DataFormatHelper