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.
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.
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?
The server must always be reinstalledMost changes are applied dynamically without a restartNothing until the next fix packThe 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.