This article documents how to temporarily disable an OSGI component via Gogo Shell, and how to add a component to the blacklist in order to disable it permanently. We will use the WebDAV component as an example.
Resolution
Disable a Component Temporarily
- Start up Liferay DXP
- Connect via Gogo Shell:
telnet localhost 11311
- As we know, WebDAV is a component of bundle com.liferay.document.library.web, we will find out the component name by the command
scr:list com.liferay.document.library.web
- In the output, we find out the full component name for WebDAV so we use the following command to disable the component.
- For users on DXP 7.0 before fix pack 37
scr:disable com.liferay.document.library.web.webdav.DLWebDAVStorageImpl
- For users on DXP 7.0 on or after fix pack 37, and users on DXP 7.1
scr:disable com.liferay.document.library.web.internal.webdav.DLWebDAVStorageImpl
- For users on DXP 7.0 before fix pack 37
Please note that the scr:disable
command disables the component on the server (or the current server node in a cluster) until the server has been restarted.
Disable a Component Permanently
- Start up Liferay DXP
- Navigate to Control Panel >Configuration >System Settings >Component Blacklist Configuration
- Add
com.liferay.document.library.web.internal.webdav.DLWebDAVStorageImpl
in the Blacklist Component Names. - Click Update
In the log, it will display a message like the following.
2018-05-02 00:54:08.725 INFO [CM Event Dispatcher (Fire ConfigurationEvent: pid=com.liferay.portal.component.blacklist.internal.ComponentBlacklistConfiguration)][ComponentBlacklistImpl:91] Disabling com.liferay.document.library.web.internal.webdav.DLWebDAVStorageImpl from bundle com.liferay.document.library.web
We could also verify the component is disabled via Gogo Shell.
Run the command scr:info com.liferay.document.library.web.internal.webdav.DLWebDAVStorageImpl
in Gogo Shell before adding the WebDav component to the blacklist.
It will show results like the following:
Component Description: ...... Component Description Properties: ...... Component Configuration: ComponentId: 1410 State: active
Run the same command in Gogo Shell again after adding the WebDav component to the blacklist. You will see there is no component configuration in the result.
Component Description: ...... Component Description Properties: ...... (No Component Configurations)
Additional Information
Please note that this feature has only been added since Liferay DXP 7.0 Fix Pack DE-40. You may also refer to the following documentation for more information.
- DXP 7.0 - Blacklisting OSGi Modules and Components
- DXP 7.1 - Blacklisting OSGi Modules and Components