Disabling OSGI Components for DXP

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.


Disable a Component Temporarily

  1. Start up Liferay DXP
  2. Connect via Gogo Shell:telnet localhost 11311
  3. 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
  4. 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

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

  1. Start up Liferay DXP
  2. Navigate to Control Panel >Configuration >System Settings >Component Blacklist Configuration
  3. Add com.liferay.document.library.web.internal.webdav.DLWebDAVStorageImpl in the Blacklist Component Names.
  4. 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:
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.

Este artigo foi útil?
Utilizadores que acharam útil: 1 de 1