Community
Liberty and Eclipse: Enable a feature
June 3, 2016 | Written by: Bobby Woolf
Categorized: Community | Compute Services
Share this post:
WebSphere Liberty is the next generation application server, and Liberty and Eclipse make a great local development environment for developing Java EE applications. One task you’ll need to be able to perform is using Eclipse to enable a Liberty feature in the server configuration. This will enable applications running in the server to use that feature.
In this excerpt from “Java EE, the next inception: Install a local Java EE development environment for WebSphere Liberty,” we’ll explore how to enable additional features for your local Liberty server using Eclipse. Next, we’ll discuss another common development task: Using Eclipse to package a Liberty server and application.
To start at the beginning of this series, see WebSphere Liberty: Developing Java EE applications for the cloud.
Enable features
When a server starts, all that runs is a kernel with no features, unless the server has been configured otherwise. (The kernel starts very fast and consumes little memory.) For the server to be useful, it needs to load features as well. As explained earlier, the list of features enabled to be loaded is specified in the feature manager section of the server configuration.
The server configuration is stored in an XML file called server.xml
, in the directory wlp/usr/servers/<server-name>
. The XML schema includes a <featureManager>
element that lists features available for the server to load. Again, for a server to load a feature, the asset for that feature must already be installed in the profile.
To add features to or remove features from a server’s feature manager’s list, edit the XML file. This can either be done in a text editor or using tooling in Eclipse.
Eclipse GUI
In Eclipse, locate the server’s configuration file and open it for editing.
- In the Servers view, select the server you want to configure.
- Expand the server to see the projects associated with it, as well as its server configuration files. Select Server Configuration [server.xml] and open its editor:
The Server Configuration editor has two views, Design and Source. You can use either one (or both) to edit the server configuration.
To display and edit the XML:
- Select the Source view. The feature manager configuration will look something like this:
<featureManager> <feature>javaee-7.0</feature> </featureManager>
- Add the Admin Center to the feature manager’s list of features by adding this line:
<feature>adminCenter-1.0</feature>
As a result of adding this line, the complete feature manager configuration will look like this:
<featureManager> <feature>javaee-7.0</feature> <feature>adminCenter-1.0</feature> </featureManager>
These two lines will load both the
javaee-7.0
and theadminCenter-1.0
features.
To edit the feature manager’s configuration using the Server Configuration designer:
- Select the Design view. In the Server Configuration structure, select Feature Manager. As shown below, the Feature Manager view will list the components:
- Press Add.
- The Add Features dialog lists all features installed in the profile that are not already listed in the feature manager (Figure 4). Select the feature shown below and and press OK to add it:
The Feature Manager view now lists these components:
See Editing the Liberty profile configuration by using developer tools for more details on using the server configuration editor.
By adding the Admin Center to the feature manager’s list of features, that feature is now enabled so that the server can load it. When you want to open the Admin Center in a browser, the default URL is https://localhost:9443/adminCenter/
.
—Bobby Woolf (@bobby_woolf)
Kubernetes Tutorials: 5 Ways to Get You Building Fast
Ready to start working with Kubernetes? Want to build your Kubernetes skills? The five tutorials in this post will teach you everything you need to know about how to manage your containerized apps with Kubernetes.
Using Portworx to Deploy and Manage an HA MySQL Cluster on IBM Cloud Kubernetes Service
This tutorial is a walkthrough of the steps involved in deploying and managing a highly available MySQL cluster on IBM Cloud Kubernetes Service.
Kubernetes v1.14.1 Now Available in IBM Cloud Kubernetes Service
We are excited to announce the availability of Kubernetes v1.14.1 for your clusters that are running in IBM Cloud Kubernetes Service. IBM Cloud Kubernetes Service continues to be the first public managed Kubernetes service to support the latest upstream versions from the community.