Legacy Knowledge Base
Published Jul. 2, 2025

LDAP users are unable to log in(Caused by: java.net.SocketException: Connection reset)

Written By

Sivakumar Perumal

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

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

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

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

Issue

  • If the LDAP is configured and when the LDAP users are trying to log in, authentication fails and started getting the following error in the server console.
ERROR [liferay/scheduler_dispatch-4][PortalLDAPImporterImpl:717] Unable to import user CN=makansal: null:null:{samaccountname=sAMAccountName: makansal}
javax.naming.CommunicationException: Connection reset [Root exception is java.net.SocketException: Connection reset]; remaining name 'CN=makansal,CN=Users,DC=ad,DC=keysight,DC=com'
 at com.sun.jndi.ldap.LdapCtx.doSearch(LdapCtx.java:2003)
 at com.sun.jndi.ldap.LdapCtx.doSearchOnce(LdapCtx.java:1934)
 at com.sun.jndi.ldap.LdapCtx.c_getAttributes(LdapCtx.java:1327)
 at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_getAttributes(ComponentDirContext.java:231)
 at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(PartialCompositeDirContext.java:139)
 at javax.naming.directory.InitialDirContext.getAttributes(InitialDirContext.java:152)
 at com.liferay.portal.security.ldap.PortalLDAPUtil._getAttributes(PortalLDAPUtil.java:905)
 at com.liferay.portal.security.ldap.PortalLDAPUtil.getUserAttributes(PortalLDAPUtil.java:582)
 at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAPByUser(PortalLDAPImporterImpl.java:702)
 at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:203)
 at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:139)
 at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:101)
 at com.liferay.portal.security.ldap.PortalLDAPImporterUtil.importFromLDAP(PortalLDAPImporterUtil.java:39)
 at com.liferay.portlet.admin.messaging.LDAPImportMessageListener.doReceive(LDAPImportMessageListener.java:51)
 at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
 at sun.reflect.GeneratedMethodAccessor383.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:606)
 at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
 at com.sun.proxy.$Proxy300.receive(Unknown Source)
 at com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper.receive(SchedulerEventMessageListenerWrapper.java:77)
 at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
 at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:71)
 at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
 at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
 at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.SocketException: Connection reset
 at java.net.SocketInputStream.read(SocketInputStream.java:196)
 at java.net.SocketInputStream.read(SocketInputStream.java:122)
 at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
 at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
 at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
 at com.sun.jndi.ldap.Connection.run(Connection.java:853)

Environment

  • Liferay DXP 7.0

Resolution

  • The above error will be observed in the server console when there is a communication failure between Liferay and LDAP. Therefore establishing a connection between Liferay and LDAP would ensure successful authentication for LDAP users.
  • To test: Ping the IP address of the LDAP server from the machine where Liferay is running to check whether it is replying or not. 

Additional Information

  • In addition to the above error, the below error can be observed, if the LDAP import option is enabled.
ERROR [liferay/scheduler_dispatch-5][PortalLDAPImporterImpl:210] Error importing LDAP users and groups 
javax.naming.NamingException: LDAP response read timed out, timeout used:15000ms.; remaining name 'CN=Users,DC=ad,DC=keysight,DC=com'
  •  The above error shows the "import" option is enabled in Liferay and it is trying to import the user from LDAP. Since there is some communication/network failure, Liferay waited for 15000ms(as the value is set in portal.properties) to get connected with the LDAP server but still, the connection is not established.
Did this article resolve your issue ?

Legacy Knowledge Base