Certain scenarios can cause the <server> element to have a diagnostic message (seen in VS Code, but probably affects all IDEs). The message basically states that the server schema cannot be loaded/found. Here are the steps to create and the explanation why it happens.
1) Open a project. Doesn't matter if it is maven/gradle, or whether it has been built previously or not.
2) Open the server.xml. There should be no diagnostics (if the project was configured correctly).
3) If the project was previously built, from the terminal, do a clean.
4) Make sure the pom.xml is either using openliberty-kernel or does not specify the runtimeArtifact.
4) From the Liberty Dashboard, select Start.
5) As the server is starting, red diagnostics will appear for some elements.
6) When the features get installed, the main <server> root element will have a diagnostic.
The reason this happens is that the installation of features causes the .libertyls directory to get deleted, and that dir has the generated xsd that is used to validate the server.xml file. After a bit of time passes, a new xsd gets generated with the newly updated Liberty runtime and the diagnostic goes away.
Not sure if there is a way for us to detect this and revert to the default schema temporarily, or if we should have a backup of the schema to use in this case until the new one gets generated?
Certain scenarios can cause the
<server>
element to have a diagnostic message (seen in VS Code, but probably affects all IDEs). The message basically states that the server schema cannot be loaded/found. Here are the steps to create and the explanation why it happens.1) Open a project. Doesn't matter if it is maven/gradle, or whether it has been built previously or not. 2) Open the server.xml. There should be no diagnostics (if the project was configured correctly). 3) If the project was previously built, from the terminal, do a
clean
. 4) Make sure the pom.xml is either usingopenliberty-kernel
or does not specify the runtimeArtifact. 4) From the Liberty Dashboard, selectStart
. 5) As the server is starting, red diagnostics will appear for some elements. 6) When the features get installed, the main<server>
root element will have a diagnostic.The reason this happens is that the installation of features causes the
.libertyls
directory to get deleted, and that dir has the generated xsd that is used to validate the server.xml file. After a bit of time passes, a new xsd gets generated with the newly updated Liberty runtime and the diagnostic goes away.Not sure if there is a way for us to detect this and revert to the default schema temporarily, or if we should have a backup of the schema to use in this case until the new one gets generated?