Legacy Knowledge Base
Published Sep. 10, 2025

Alternative to using the Registry API in Liferay DXP 7.4

Written By

Jose Bodega

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

Environment

  • 2024.Q3

Resolution

  • Registry API  has been removed in Liferay 7.4 -> Documentation .The mentioned alternative would be based on using the SystemBundleUtil.java class.

  • An example of using the LDAPUserImporter class in a Groovy script is provided:

Use for Liferay 7.3 

import com.liferay.registry.RegistryUtil;
import com.liferay.portal.security.ldap.exportimport.LDAPUserImporter;

def registry = RegistryUtil.getRegistry();
def ldapUserImporter= registry.getService(registry.getServiceReference(LDAPUserImporter.class));
[...]

 

Use for 7.4


import com.liferay.portal.kernel.module.util.SystemBundleUtil;
import org.osgi.framework.BundleContext;
import com.liferay.portal.security.ldap.exportimport.LDAPUserImporter;

BundleContext bundleContext = SystemBundleUtil.getBundleContext();
def ldapUserImporter = bundleContext.getService(bundleContext.getServiceReference(LDAPUserImporter.class));
[...]

 

NOTE: The following resolution requires customization and should only be implemented at the discretion of your team. Liferay Support will not be able to assist with designing or implementing customizations.

 

 

 

Did this article resolve your issue ?

Legacy Knowledge Base