Foros de discusión

[RESOLVED] LDAP Issue - No Contact exists with the primary key

thumbnail
Chris Whittle, modificado hace 15 años.

[RESOLVED] LDAP Issue - No Contact exists with the primary key

Expert Mensajes: 462 Fecha de incorporación: 17/09/08 Mensajes recientes
Trying to implement LDAP with our system and everything tests out alright until we try to log in and we get a NullPointerException
See Below... I think it's a Ldap setting that could be the issue but not sure.... (the picture are those settings but the post cuts it off so you will need to download the image to see it.)
Thanks

15:40:50,006 ERROR [UserImpl:187] com.liferay.portal.NoSuchContactException: No Contact exists with the primary key 11704
15:40:50,006 ERROR [LDAPAuth:52] Problem accessing LDAP server: null
15:40:50,194 ERROR [MainServlet:693] com.liferay.portal.kernel.events.ActionException: java.lang.NullPointerException
com.liferay.portal.kernel.events.ActionException: java.lang.NullPointerException
	at com.liferay.portal.events.ServicePreAction.run(ServicePreAction.java:146)
	at com.liferay.portal.events.EventsProcessor._processEvent(EventsProcessor.java:142)
	at com.liferay.portal.events.EventsProcessor._process(EventsProcessor.java:119)
	at com.liferay.portal.events.EventsProcessor.process(EventsProcessor.java:76)
	at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:671)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:132)
	at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:282)
	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:71)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:132)
	at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.doFilter(VirtualHostFilter.java:147)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:132)
	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:74)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
	at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
	at com.liferay.portal.events.ServicePreAction.addDefaultUserPrivateLayouts(ServicePreAction.java:270)
	at com.liferay.portal.events.ServicePreAction.updateUserLayouts(ServicePreAction.java:1530)
	at com.liferay.portal.events.ServicePreAction.servicePre(ServicePreAction.java:987)
	at com.liferay.portal.events.ServicePreAction.run(ServicePreAction.java:143)
	... 36 more
thumbnail
The Meurwinn Concept, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

Expert Mensajes: 261 Fecha de incorporación: 10/04/06 Mensajes recientes
Hi,

who is the user in the "user_" table with a contact id 11704 ?
Is it the Liferay default user ?
thumbnail
Chris Whittle, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

Expert Mensajes: 462 Fecha de incorporación: 17/09/08 Mensajes recientes
Hi there,
No there actually are no other users other than the default user(10127) in the liferay db... We want to use LDAP as the source for all our users...
thumbnail
The Meurwinn Concept, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

Expert Mensajes: 261 Fecha de incorporación: 10/04/06 Mensajes recientes
Does the "contact id" column of the default user in the "user_" tables is "11704 " ?


We had the same problem at the creation of the database. Twice, the contact associated to the default user was not create in the "contact_" table...
thumbnail
Chris Whittle, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

Expert Mensajes: 462 Fecha de incorporación: 17/09/08 Mensajes recientes
It looks like it's adding them to the user_ table but not the contact table...
thumbnail
The Meurwinn Concept, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

Expert Mensajes: 261 Fecha de incorporación: 10/04/06 Mensajes recientes
The "contact" are only created for default user and admin user ? !!!

Did you try to update (with the user admin portlet) the users 11701...11703... perhaps it will create an associated contact ?
thumbnail
Chris Whittle, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

Expert Mensajes: 462 Fecha de incorporación: 17/09/08 Mensajes recientes
they don't show up in the admin portlet....
Maybe I'm missing a step...
1) Setting up ldap (No Import/export)
2) Testing Ldap
3) Trying to login with a screenname from LDAP
thumbnail
The Meurwinn Concept, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

Expert Mensajes: 261 Fecha de incorporación: 10/04/06 Mensajes recientes
How did you create the users ? With the admin portlet or with an ldap import ?
thumbnail
Chris Whittle, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

Expert Mensajes: 462 Fecha de incorporación: 17/09/08 Mensajes recientes
Neither... When i attempted to login with the user ids it creates them and pulls their info from LDAP
thumbnail
Scott Lee, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

Junior Member Mensajes: 55 Fecha de incorporación: 26/09/06 Mensajes recientes
what version of liferay are you running?
thumbnail
Chris Whittle, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

Expert Mensajes: 462 Fecha de incorporación: 17/09/08 Mensajes recientes
5.1.2
C B, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

Regular Member Mensajes: 120 Fecha de incorporación: 30/08/07 Mensajes recientes
Chris Whittle:
5.1.2

I have the same problem with version 5.1.2. I get an error, because no contact is stored at the database! Any ideas how to solve this problem?
Shravan A, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

Junior Member Mensajes: 29 Fecha de incorporación: 5/01/09 Mensajes recientes
i am unable to login with users created in liferay
but i can through users created in LDAP

i have enabled export option in LDAP
what might be the problem
akram Ben Salem, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

New Member Mensajes: 2 Fecha de incorporación: 20/04/09 Mensajes recientes
Hi All,

... I'm getting the same problem with MySQL 5 ... is there any fix in the future for this emoticon ?
thumbnail
Amos Fong, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

Liferay Legend Mensajes: 2047 Fecha de incorporación: 7/10/08 Mensajes recientes
It should be fixed by this ticket:

http://issues.liferay.com/browse/LPS-2755
thumbnail
Chris Whittle, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

Expert Mensajes: 462 Fecha de incorporación: 17/09/08 Mensajes recientes
I changed some settings in the mapping (not sure exactly what I changed) but now it works for some people and not for others...
thumbnail
Chris Whittle, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

Expert Mensajes: 462 Fecha de incorporación: 17/09/08 Mensajes recientes
and it's not letting me go to my account even though it did let me get in.. gives me the error below

Internal Server Error
An error occurred while accessing the requested resource.

http://websvd11/web/guest/3?p_p_id=2&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&p_p_col_count=2&_2_struts_action=%2Fmy_account%2Fedit_user&_2_backURL=%2Fweb%2Fguest%2F
thumbnail
Chris Whittle, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

Expert Mensajes: 462 Fecha de incorporación: 17/09/08 Mensajes recientes
got this fixed... Looks like it was a DB2 Dialect issue... I changed it to the liferay DB2 Custom dialect and it seems like it fixed it...
Abdelkader Samir, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

New Member Mensajes: 3 Fecha de incorporación: 5/09/08 Mensajes recientes
I have the same problem, I m using Liferay 5.1.2 and mysql 5.0.
The user from ldap exist now in user_ table (but not in contact_ table), when I try to login, i get these error

09:58:55,211 ERROR [UserImpl:187] com.liferay.portal.NoSuchContactException: No Contact exists with the primary key 10175
09:58:55,242 ERROR [MainServlet:664] com.liferay.portal.ModelListenerException: javax.naming.directory.SchemaViolationException: [LDAP: error code 67 - failed to modify e
ntry cn=b.obama+givenname=Obama+mail=b.obama@liferay.net+sn=Barak+title=president+userpassword=test,dc=example,dc=com: Modify operation attempts to delete RDN attribute v
alues in use for 2.5.4.42 on entry 0.9.2342.19200300.100.1.3=b.obama@liferay.net+2.5.4.12=president+2.5.4.3=b.obama+2.5.4.35=test+2.5.4.4=barak+2.5.4.42=obama,0.9.2342.19
200300.100.1.25=example,0.9.2342.19200300.100.1.25=com and violates schema constraints]; remaining name 'cn=b.obama+givenname=Obama+mail=b.obama@liferay.net+sn=Barak+titl
e=president+userpassword=test,dc=example,dc=com'

any ideas
Peter Fyon, modificado hace 15 años.

RE: LDAP Issue - No Contact exists with the primary key

New Member Mensajes: 6 Fecha de incorporación: 21/07/08 Mensajes recientes
I'm having the exact same issue.

Using Liferay 5.1.2 and mysql 5.0.51a, a user will be imported and created in the database, but not created in the Contact_ table. I've poked around in the code and can't find anything except that it generates the contact with

Contact contact = contactPersistence.create(user.getContactId());

whereas userId (which is being generated just fine) is assigned with

long userId = counterLocalService.increment();

Does anyone have any ideas on how to fix this so users will be imported once again to the database from the LDAP?
thumbnail
Amos Fong, modificado hace 14 años.

RE: LDAP Issue - No Contact exists with the primary key

Liferay Legend Mensajes: 2047 Fecha de incorporación: 7/10/08 Mensajes recientes
Hi Peter,

The reason is it tries to export before importing has finished. Therefore there is an exception when it exports(because there is no contact) which then stops the user creation process leaving the user without a contact.

The fix is in UserListener.java, you should modify it to look like this:

public class UserListener extends BaseModelListener<user> {

	public void onAfterUpdate(User user) throws ModelListenerException {
		try {
			if (!user.isDefaultUser()) {
				PortalLDAPUtil.exportToLDAP(user);
			}
		}
		catch (Exception e) {
			throw new ModelListenerException(e);
		}
	}

}</user>
thumbnail
Mitul Khamar, modificado hace 8 años.

RE: [RESOLVED] LDAP Issue - No Contact exists with the primary key

New Member Mensajes: 21 Fecha de incorporación: 12/02/15 Mensajes recientes
Add following properties in portal-ext.properties file and restart server

value.object.entity.cache.enabled.com.liferay.portal.model.Contact=false