自5天以来我有完全相同的问题,无法将用户和组从OpenLDAP导入Liferay CE 6.1 ... 这是我的OpenLDAP的结构:
World
--tn
----com
------domain
--------admin
--------Computers
--------domain
--------Groups
----------IT
------------cn
------------gidNumber
------------objectClass
------------memberUid (n member)
--------Users
----------uid0001
------------cn
------------gidNumber
------------homeDirectory
------------objectClass
------------sn
------------uid
------------uidNumber
------------givenName
------------loginShell
------------userPassword
这是我的portal-ext.porperties文件:
## LDAP Server Settings
ldap.base.provider.url=ldap://controller.domain.com.tn:389
ldap.base.dn=DC=domain,DC=com,DC=tn
# authentication
ldap.security.principal=cn=admin,dc=domain,dc=com,dc=tn
ldap.security.credentials=My Password !
# search from this point in the tree
ldap.users.dn=DC=domain,DC=com,DC=tn
# You can write your own class that implements
# com.liferay.portal.security.ldap.AttributesTransformer to transform the
# LDAP attributes before a user or group is imported to the LDAP store.
ldap.attrs.transformer.impl=com.liferay.portal.security.ldap.DefaultAttributesTransformer
# standard mappings, must be present in LDAP or we get an exception
#ldap.user.mappings=screenName=cn\npassword=userPassword\nemailAddress=\nfirstName=givenName\nlastName=sn\njobTitle=\ngroup=
ldap.user.mappings=screenName=cn\npassword=userPassword\nfirstName=givenName\nlastName=sn\njobTitle=title\ngroup=groupMembership\nemailAddress=uid
ldap.auth.search.filter=(mail=@user_id@)
ldap.import.user.search.filter=(objectClass=inetOrgPerson)
## Import, users can be imported on demand at login or at startup and at regular intervals.
ldap.import.enabled=true
ldap.import.interval=360
ldap.import.on.startup=true
ldap.export.enabled=false
ldap.user.default.object.classes=inetOrgPerson,organizationalPerson
## Custom Mappings, same format as ldap.user.mappings
##Commented by ME : ldap.user.custom.mappings=nickname=mailNickname\ndisplay=cn
## Added from this link : http://www.liferay.com/community/forums/-/message_boards/message/5681334
users.screen.name.validator=com.liferay.portal.security.auth.LiberalScreenNameValidator
users.screen.name.allow.numeric=true
##added from this link : http://issues.liferay.com/browse/LPS-14519
users.screen.name.always.autogenerate=true
##added from this link : http://vkbardia.blogspot.com/2012/05/liferay-authentication-fails-for-screen.html?showComment=1345199625453#c3592789922325172023
users.email.address.required= false
#Groups
ldap.group.mappings=groupName=cn\ndescription=description\nuser=memberUid
ldap.import.create.role.per.group=false
PS:我的用户没有电子邮件字段,这就是我希望他们使用UID登录的原因。 PS:在eclipse中运行时我得到了这个:
13:35:47,450 ERROR [PortalLDAPImporterImpl:196] Error importing LDAP users and groups
java.lang.NullPointerException
at com.liferay.portal.kernel.io.unsync.UnsyncStringReader.<init>(UnsyncStringReader.java:33)
at com.liferay.portal.kernel.util.PropertiesUtil.load(PropertiesUtil.java:199)
at com.liferay.portal.kernel.util.PropertiesUtil.load(PropertiesUtil.java:192)
at com.liferay.portal.security.ldap.LDAPSettingsUtil.getUserExpandoMappings(LDAPSettingsUtil.java:124)
at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:169)
at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:128)
at com.liferay.portal.security.ldap.PortalLDAPImporterUtil.importFromLDAP(PortalLDAPImporterUtil.java:34)
at com.liferay.portal.util.PortalInstances._initCompany(PortalInstances.java:448)
at com.liferay.portal.util.PortalInstances.initCompany(PortalInstances.java:92)
at com.liferay.portal.servlet.MainServlet.initCompanies(MainServlet.java:766)
at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:336)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5001)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5289)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1581)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
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:619)
PS:我正在详细写下这一切,因为这对我来说非常重要。
等待你的帮助。
Best&amp;此致
答案 0 :(得分:1)