legacy-knowledge-base
公開されました Jun. 30, 2025

Calling UserImporter in com.liferay.portal.security.exportimport.api throws unsatisfied references error.

written-by

Sorin Pop

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

On 7.3 we are using this class to Import users from a SamlProvider:

com.liferay.portal.security.exportimport.UserImporter.importUser(long companyId, String emailAddress, String screenName)

We call the service by using the @Reference annotation

@Reference(unbind = "-")
public void setUserImporter(UserImporter userImporter) {
this.userImporter = userImporter;
}
private UserImporter userImporter;
However, on 7.4 Q1.7 we are encountering this error:
	Declarative Service {id: 6667, name: com.infor.rhythm.portal.hooks.saml.override.RhythmUserResolver, unsatisfied references: 
		{name: UserImporter, target: null}
	}

 I look on the source code and found that UserImporter @ProvidedType was added but I can't find the Service method associated with the UserImporter interface. 

This is the github link reference: LPS-123218 Expand UserImporter API to allow user import by UUID · liferay/liferay-portal@a0c7cd1 (github.com)

This might be why it has a Null reference I saw on Gogoshell. I also saw that LDAPUserImporter is extending UserImporter. Although the method I need is

importUser(long companyId, String emailAddress, String screenName) 

which is not callable on LDAPUserImporter. The only method on that class is 

    public User importUser(
            long ldapServerId, long companyId, SafeLdapContext safeLdapContext,
            Attributes attributes, String password)

Environment

  • 2024.q1

Resolution

We believe the issue is that the only implementation of UserImporter (LDAPUserImporterImpl) doesn't advertise itself as providing the UserImporter service, and so the reference cannot be satisfied.

So anything that uses those methods ends up waiting for the LDAPUserImporter service instead.

Additionally, you will need to include the below in to pom.xml file:

<dependency>
<groupId>com.liferay</groupId>
<artifactId>com.liferay.portal.security.exportimport.api</artifactId>
<scope>provided</scope>
</dependency>

 

 

 

did-this-article-resolve-your-issue

legacy-knowledge-base