Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-97832

ConfigurationExtender generates factoryPid from configuration files in bundle incorrectly


    • Type: Bug
    • Status: Verified
    • Resolution: Unresolved
    • Affects Version/s: DXP SP12, 7.0.X, SP2, 7.1.10 DXP FP14, 7.1.X, 7.2.0 GA1, DXP SP1, 7.2.X, Master
    • Fix Version/s: None
    • Component/s: Core Infrastructure
    • Labels:
    • Fix Priority:



      Bundles containing configuration files in folder defined by "Liferay-Configuration-Path" in bnd.bnd (*.properties or *.config files), for example REST bundles using REST Extender.

      Steps to reproduce

      1. Deploy sample REST bundle using REST Extender https://github.com/liferay/liferay-blade-samples/tree/7.0/maven/apps/rest

      Expected result

      • REST Extender and CXF endpoint configuration registered and visible in Control Panel - Configuration - System Settings - Web API
      • REST endpoint accessible on URL defined in configuration

      Actual result

      • Configuration not registered and visible in Control panel
      • REST enpoint not accessible

      Probable cause

      After refactoring of ConfigurationExtender done in LPS-94399, method "_addNamedConfigurations" generates "factoryPid" of configuration based on configuration file's name incorrectly.



      int lastIndexOfSlash = name.lastIndexOf('/');
      factoryPid = name.substring(lastIndexOfSlash, index);

      causes "factoryPid" to start with slash, which shouldn't be there.


      For example: "/com.liferay.portal.remote.rest.extender.configuration.RestExtenderConfiguration"

      After that when ConfigurationModelRetrieverImpl::getFactoryConfigurations tries to find configurations of for example "com.liferay.portal.remote.rest.extender.configuration.RestExtenderConfiguration" without the slash, it fails to pick up this configuration.

      Possible workaround

      For most cases it should be possible to set up the configurations in Control Panel manually.

      For example set up REST Extender and CXF Endpoint in Control Panel - Configuration - System Settings - Web API manually to make the REST endpoint working.


      I am aware that using REST Extender for REST endpoints is no longer the preferred way in Liferay 7.2, but this bug in ConfigurationExtender can also have consequences in other use cases, and it seems it shouldn't be difficult to fix.




            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created:
                Days since last comment:
                17 weeks, 2 days ago


                Version Package