Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle empty feature element better for dev mode #1682

Closed
cherylking opened this issue Jun 5, 2023 · 1 comment · Fixed by #1683
Closed

Handle empty feature element better for dev mode #1682

cherylking opened this issue Jun 5, 2023 · 1 comment · Fixed by #1683
Labels

Comments

@cherylking
Copy link
Member

If a developer modifies their server.xml and accidentally leaves an empty <feature></feature> element in it, detect it and issue a warning on both dev mode start and restart, do not pass the empty feature to install-feature goal, and allow the process to continue. Currently, the following behavior happens:

  1. If you start dev mode from the command line using mvn liberty:dev for a project that contains an empty feature element in server.xml, it fails.
[ERROR] Failed to execute goal io.openliberty.tools:liberty-maven-plugin:3.8:dev (default-cli) on project guide-getting-started: Error installing features for server defaultServer: CWWKF1299E: The following features could not be obtained: . Ensure that the features are valid for Open Liberty. -> [Help 1]
  1. If you have dev mode running from command line, then edit the server.xml to add an empty feature element and save it...it gets an error but continues running dev mode.
[INFO] Installing features: [, jsonb-2.0, mphealth-4.0, mpconfig-3.0, mpmetrics-4.0, restfulws-3.0, jsonp-2.0, cdi-3.0]

[ERROR] Failed to install features from configuration file
org.apache.maven.plugin.MojoExecutionException: Error installing features for server defaultServer
    at io.openliberty.tools.maven.server.InstallFeatureMojo.doInstallFeatures (InstallFeatureMojo.java:77)
    at io.openliberty.tools.maven.server.InstallFeatureMojo.execute (InstallFeatureMojo.java:66)

The server shutdown works fine when I press q and hit enter key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant