WebSphere Tutorial · WebSphere Liberty · Lesson 5 of 23

server.xml and Features

Liberty's feature model: enabling only what an application needs, convenience features, and dynamic configuration.

Members can save this page, take notes and track progress. See membership · Sign in

Features

Liberty loads only the features listed in server.xml, plus the features they depend on:

<server description="orders">
  <featureManager>
    <feature>restfulWS-3.1</feature>
    <feature>jsonb-3.0</feature>
    <feature>cdi-4.0</feature>
    <feature>jdbc-4.3</feature>
    <feature>mpHealth-4.0</feature>
  </featureManager>
  <httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="9080" httpsPort="9443"/>
  <webApplication location="orders.war" contextRoot="/"/>
</server>

Convenience features enable a whole platform (webProfile-10.0, jakartaee-10.0, microProfile-6.1), handy to start but slower and larger than listing what you use.

Dynamic updates

Liberty watches its configuration: change server.xml and most updates apply in seconds without a restart, which is why development mode feels so fast. In production containers the configuration is baked into the image instead.

Features listed versus features resolved with their dependenciesTry it yourself
import xml.etree.ElementTree as ET

server_xml = """<server>
  <featureManager>
    <feature>restfulWS-3.1</feature><feature>jdbc-4.3</feature><feature>mpHealth-4.0</feature>
  </featureManager>
</server>"""
depends = {"restfulWS-3.1": ["servlet-6.0", "cdi-4.0"], "mpHealth-4.0": ["cdi-4.0", "jsonp-2.1"], "jdbc-4.3": []}

enabled = [f.text for f in ET.fromstring(server_xml).iter("feature")]
resolved = set(enabled)
for f in enabled:
    resolved.update(depends.get(f, []))
print("listed:  ", ", ".join(enabled))
print("resolved:", ", ".join(sorted(resolved)))

Output

listed:   restfulWS-3.1, jdbc-4.3, mpHealth-4.0
resolved: cdi-4.0, jdbc-4.3, jsonp-2.1, mpHealth-4.0, restfulWS-3.1, servlet-6.0

Test yourself

What happens when you edit server.xml on a running Liberty server?

  1. The server must always be reinstalled
  2. Most changes are applied dynamically without a restart
  3. Nothing until the next fix pack
  4. The admin console must approve it
Show answer

Answer: Most changes are applied dynamically without a restart

Liberty monitors its configuration and updates the running server.

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake