legacy-knowledge-base
公開されました 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

learn-legacy-article-disclaimer-text

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