Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
updating user with LDAPS protocol
Hi Guys
Im trying to add and update users on liferay and sync with LDAP... Problem is whe i create user it works fine. But when i'm trying to update user i have this error.
11:19:11,873 DEBUG [http-nio-8080-exec-3][DefaultPortalLDAP:525]
No LDAP server configuration available for LDAP server 30232 and
company 20116<br> 11:19:11,875 DEBUG
[http-nio-8080-exec-3][DefaultPortalLDAP:144]
{java.naming.provider.url=ldaps://ldap.polarising.com:636,
java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory,
com.sun.jndi.ldap.connect.timeout=500,
com.sun.jndi.ldap.connect.pool=true,
java.naming.security.principal=uid=liferay-admin,ou=applications,ou=users,dc=polarising,dc=com,
java.naming.security.credentials=********,
java.naming.referral=follow,
com.sun.jndi.ldap.read.timeout=15000}<br> 11:19:11,875 WARN
[http-nio-8080-exec-3][DefaultPortalLDAP:156] Unable to bind to the
LDAP server<br> 11:19:11,877 DEBUG
[http-nio-8080-exec-3][DefaultPortalLDAP:160]
javax.naming.CommunicationException: ldap.polarising.com:636 [Root
exception is java.lang.ClassNotFoundException:
javax.net.ssl.SSLSocketFactory cannot be found by
com.polarising.intranet.portlets.employees_3.4.0]<br>
javax.naming.CommunicationException: ldap.polarising.com:636 [Root
exception is java.lang.ClassNotFoundException:
javax.net.ssl.SSLSocketFactory cannot be found by com.polarising.intranet.portlets.employees_3.4.0]
Is something regarding SSLSocketFactory.
to add user i'm using:
ServiceContext serviceContext =
ServiceContextFactory.getInstance(User.class.getName(), request);
Long companyId =
CompanyThreadLocal.getCompanyId();<br> UserGroup userGroup
= UserGroupLocalServiceUtil.getUserGroup(companyId,
"Pre-Employee");<br> <br> long[]
userGroupIds = new long[1];<br> userGroupIds[0] = userGroup.getUserGroupId();
User user =
UserLocalServiceUtil.addUser(adminUser.getUserId(),
themeDisplay.getCompanyId(), true,<br> null, null,
false, ParamUtil.getString(request, "username"),
ParamUtil.getString(request, "email"), 0,<br>
"", themeDisplay.getLocale(),
ParamUtil.getString(request, "firstname"),<br>
ParamUtil.getString(request, "middlename"),
ParamUtil.getString(request, "lastname"), 0, 0, true, 0,
1,<br> 1970, "", null, null, null,
userGroupIds, true, serviceContext);
return user;
and to update email an usergroup (this one give error)
update email:
User user = UserLocalServiceUtil.getUser(Long.valueOf(userId));
if
(!user.getEmailAddress().equals(ParamUtil.getString(request,
"email"))) {<br>
user.setEmailAddress(ParamUtil.getString(request,
"email"));<br> user.setModifiedDate(new
Date());<br>
UserLocalServiceUtil.updateUser(user);<br> }
update usergroup:
UserGroupLocalServiceUtil.deleteUserUserGroup(employee.getInternalUserId(),
preemployeeUserGroup.getUserGroupId());<br>
UserGroupLocalServiceUtil.addUserUserGroup(employee.getInternalUserId(), colaboradorUserGroup.getUserGroupId());
Thanks for help
Vitor Manuel Lopes:[Root exception is java.lang.ClassNotFoundException: javax.net.ssl.SSLSocketFactory cannot be found by com.polarising.intranet.portlets.employees_3.4.0]
Liferay ran into the same problem in its My Account portlet, as
reported in LPS-69168. You
can fix it by adding Import-Package: javax.net.ssl,* to
the bnd.bnd for your module. An example of the change is
inside the commit
for LPS-69168.
I will try it... thanks