Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Jason Morton
6.0.5 ldap.import.interval ????
August 20, 2010 1:27 PM
Answer

Jason Morton

Rank: Junior Member

Posts: 31

Join Date: August 18, 2010

Recent Posts

I have setup ldap through the GUI, with it I enabled import and import on start up. However, I am not seeing how to set the import interval. I went into the ROOT.war/WEB-INF/liferay-portlet.xml and found
1
2                <simple>
3                    <property-key>ldap.import.interval</property-key>
4                    <time-unit>minute</time-unit>
5                </simple>


From this I don't understand how to define the number of minutes.
Shagul Khajamohideen
RE: 6.0.5 ldap.import.interval ????
August 21, 2010 4:54 AM
Answer

Shagul Khajamohideen

Rank: Liferay Master

Posts: 759

Join Date: September 27, 2007

Recent Posts

Looks like there was confusion about the "ldap.import.interval" property. You could try overriding them in portal-ext.properties file. The UI does not seem to support.

http://issues.liferay.com/browse/LPS-8325

http://issues.liferay.com/browse/LPS-9213
Jason Morton
RE: 6.0.5 ldap.import.interval ????
August 23, 2010 8:29 AM
Answer

Jason Morton

Rank: Junior Member

Posts: 31

Join Date: August 18, 2010

Recent Posts

Now that I am able to set the import interval I am getting this error:


15:24:16,636 ERROR [PortalLDAPImporterImpl] Unable to import user CN=Mena: null:null:{cn=cn: Mena}
com.liferay.portal.ContactFirstNameException
at com.liferay.portal.service.impl.UserLocalServiceImpl.validateFullName(UserLocalServiceImpl.java:3163)
at com.liferay.portal.service.impl.UserLocalServiceImpl.validate(UserLocalServiceImpl.java:3094)
at com.liferay.portal.service.impl.UserLocalServiceImpl.addUser(UserLocalServiceImpl.java:344)
at sun.reflect.GeneratedMethodAccessor475.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:44)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy319.addUser(Unknown Source)
at com.liferay.portal.service.UserLocalServiceUtil.addUser(UserLocalServiceUtil.java:287)
at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.addUser(PortalLDAPImporterImpl.java:302)
at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importUser(PortalLDAPImporterImpl.java:608)
at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAPByUser(PortalLDAPImporterImpl.java:460)
at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:169)
at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:122)
at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:85)
at com.liferay.portal.security.ldap.PortalLDAPImporterUtil.importFromLDAP(PortalLDAPImporterUtil.java:30)
at com.liferay.portlet.admin.messaging.LDAPImportMessageListener.doReceive(LDAPImportMessageListener.java:38)
at com.liferay.portlet.admin.messaging.LDAPImportMessageListener.receive(LDAPImportMessageListener.java:30)
at sun.reflect.GeneratedMethodAccessor521.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:54)
at $Proxy473.receive(Unknown Source)
at com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper.receive(SchedulerEventMessageListenerWrapper.java:57)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:63)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:61)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)



I have 5 users in Active Directory 2 are imported 3 are throwing the error above.


Test out put:

Test LDAP Users

A subset of users has been displayed for you to review.

# Screen Name Email Address First Name Last Name Password Job Title Group
1 user2user2lastname user2@custad.local User2 User2lastname 1
2 user3 user3lastname user3@email.com User3 User3Lastname 1
3 admin2 admin2@custad.local Admin66 Test Admin2 Job Title Here 1
4 test user1 testuser1@email.com Test User1 TestUser1 Job title 2
5 joebloggs test@liferay.com Joe Bloggs 0
6 mena mena@custad.local Mena play with 0
Shagul Khajamohideen
RE: 6.0.5 ldap.import.interval ????
August 23, 2010 9:49 AM
Answer

Shagul Khajamohideen

Rank: Liferay Master

Posts: 759

Join Date: September 27, 2007

Recent Posts

Hey Jason,

Based on the error it looks like there is some issue with the FirstName for those users. You should investigate in that direction. Also you could look for posts/blogs on LDAP attribute mapping.
Jason Morton
RE: 6.0.5 ldap.import.interval ????
August 23, 2010 9:54 AM
Answer

Jason Morton

Rank: Junior Member

Posts: 31

Join Date: August 18, 2010

Recent Posts

This ended up being an issue with the Syntax on the CN. The space was causing the failure to import. Once I removed the space the import was successful.
Scott Palmer
RE: 6.0.5 ldap.import.interval ????
March 7, 2011 8:03 PM
Answer

Scott Palmer

Rank: Junior Member

Posts: 36

Join Date: January 8, 2010

Recent Posts

If the liferay portal-ext.properties import interval does not give you enough control over the import you can set a custom import timing in /%LIFERAY%/WEB-INF/liferay-portlet.xml:

 1<portlet>
 2        <portlet-name>9</portlet-name>
 3        <icon>/html/icons/default.png</icon>
 4        <struts-path>admin</struts-path>
 5        <scheduler-entry>
 6            <scheduler-event-listener-class>com.liferay.portlet.admin.messaging.LDAPImportMessageListener</scheduler-event-listener-class>
 7            <trigger>
 8        <!-- see http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html for info on how to set the timings - NOTE: it's not in cron format it's quartz below example is daily at midnight -->
 9        <cron>
10          <cron-trigger-value>0 0 0 * * ?</cron-trigger-value>
11        </cron>
12        <!-- NOTE the trigger is not cron it's quartz -->
13<!--
14                <simple>
15                    <property-key>ldap.import.interval</property-key>
16                    <time-unit>minute</time-unit>
17                </simple>
18-->
19            </trigger>
20        </scheduler-entry>
21        <portlet-url-class>com.liferay.portal.struts.StrutsActionPortletURL</portlet-url-class>
22        <use-default-template>false</use-default-template>
23        <private-request-attributes>false</private-request-attributes>
24        <private-session-attributes>false</private-session-attributes>
25        <render-weight>50</render-weight>
26        <css-class-wrapper>portlet-admin</css-class-wrapper>
27</portlet>