Apache Felix Web Console
The main technological change that Liferay DXP incorporates is the use of OSGi. Liferay uses the OSGi implementation Apache Felix, usually all the administration of the modules are done using the Gogo shell but there are other ways, as the one that we are showing here.
- List bundles
- Install update or remove bundles
- Bundle details, meta-information
- Bundles configuration
- List OSGi Services
- Relationship between services and bundles
- Licenses managed inside bundles
- System information
Why is Apache Felix Web Console so interesting?
- In some situations is not possible to access the machines to admin the bundles, neither telnet Gogo Shell neither SSH.
- Sometimes the operators have no knowledge of Liferay administration and do not know how access to the settings section, or simply has no rights to do it.
- When you need to locate a service, for example to override it with another service rank.
- Start Liferay DXP
- Connect to Gogo shell
- Install web console jar directly from Internet, execute the install command on the gogo shell :
- The new module only will be installed, you need to start it manually.
- Use command “lb” to list the modules and locate the web console recently installed.
- Execute the start command on the Gogo Shell:
- After the module starts, you can go to http://localhost:8080/o/system/console
- The default credentials are: admin/admin
In that section, you can get a list of the bundles deployed on the OSGi container, included all the modules that conform Liferay itself.
Also in the top of the table there is a searcher to help us find the correct bundle ( a Liferay bundle has more than 500 bundles ). For example, if we can know the bundles involved with the JournalArticles:
From the list (filtered or not) we can access to all the details and meta-information of each bundle. To see the details only is necessary click on the icon triangle beside Bundle name.
This information could be very useful when you need to know the dependencies or the packages exported by a bundle.
To install a new bundle only is necessary access to the upload form, is present in the top-right side of the table:
You can select if the bundle must be immediately started.
To uninstall a bundle only is necessary click on the last button present on the right side of the table:
The Web Console also includes a section to manage the Configuration API of OSGI.
When an application is deployed to Liferay, it’s common to need different configurations depending on the scope. That means having different configurations for a given application per virtual instance (a.k.a. Company), site (a.k.a. Group), or portlet instance. Liferay Portal provides an easy way to achieve this with little effort through a new framework called the Configuration API that is based on the standard OSGi Configuration Admin API.
Usually, the way to modify this configuration is using the control panel, xml files stored inside OSGI folder or programmatically with the API. With the web console we have another way to achieve that.
Going to http://localhost:8080/o/system/console/configMgr we get a list of all the configurations available on the OSGi container.
Clicking on each element a pop-up will be open with the configuration values in a form in which we can modify the values or even reset to default values.
The alert triangle informs us that the values that we are showing are the default ones, similar to the Liferay control panel view:
If we change the values on webconsole:
NOTE: Is necessary mark the left checkbox to save the value.
Immediately the changes are reflected on Liferay:
Going to http://localhost:8080/o/system/console/services we get a list of all the services registered on the Service Registry. Here we can find all the Liferay Services and also our custom services. Remember that even clases like MVCRenderCommand or MVCActionCommand are services, for this reason we can find here almost every view or action deployed on the portal.
Clicking on the service name we can see all the details, and at the right side we have identified the bundles that provide that service.
As you can imagine, there are thousands of services, on the top of the table you can use a search form to filter the results.