cancel
Showing results for 
Search instead for 
Did you mean: 

java.lang.NullPointerException in LDAP&AD users sync after upgrade from Alfresco 4.2 to 5.0

stivek
Champ in-the-making
Champ in-the-making
Hi all,

We are testing upgrade from 4.2 to 5.0 but got blocked due a problem with LDAP&AD users synchronization.

After we migrated our working LDAP & AD configurations from 4.2 to 5.0 during synchronization we got this error for each user in LDAP and AD:

WARN  [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] [http-apr-8980-exec-9] Synchronization,Category=directory,id1=ldap-local,id2=6 User Creation and Association: Failed to process entry "uid=test_ldap,ou=testOU,dc=my-domain,dc=com".
java.lang.NullPointerException
   at org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer$1PersonWorker.process(ChainingUserRegistrySynchronizer.java:1735)
   at org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer$1PersonWorker.process(ChainingUserRegistrySynchronizer.java:1710)
   at org.alfresco.repo.batch.BatchProcessor$TxnCallback.execute(BatchProcessor.java:712)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:454)
   at org.alfresco.repo.batch.BatchProcessor$TxnCallback.run(BatchProcessor.java:756)
   at org.alfresco.repo.batch.BatchProcessor.process(BatchProcessor.java:398)
   at org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer.syncWithPlugin(ChainingUserRegistrySynchronizer.java:1818)
   at org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer.synchronizeInternal(ChainingUserRegistrySynchronizer.java:700)
   at org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer.createMissingPerson(ChainingUserRegistrySynchronizer.java:813)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)…..



We did some debugging of 5.0b code which led us to #1735 line of code in org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer


nameChecker.evaluate(personName);


after which the above exception is thrown. The reason for the exception is that the object nameChecker is null when the call of process() method happens.
We checked the source code of Alfresco 4.2 and there the nameChecker object and related code is not existing.

We tested against 2 different LDAP servers and one AD server with the same result.
We also tested against Alfresco 5.0 One first by migrating LDAP & AD configurations and then by creating configuration manually in Admin Console but again we got the same error.

I opened an issue https://issues.alfresco.com/jira/browse/ALF-21284 regarding this problem but there is not activity on the issue yet.

Will be grateful if you try to help,
Stoyan
5 REPLIES 5

afaust
Legendary Innovator
Legendary Innovator
Hello,

I just looked at the source code and configuration of Alfresco One 5.0 (5.0.0.6) and everything seems to be in order. The NameChecker code exists, a NameChecker bean is defined and injected into the ChainingUserRegistrySynchronizer. The NullPointerException should not occur. Which Alfresco One version of 5.0 did you use?

Regards
Axel

stivek
Champ in-the-making
Champ in-the-making
Thank you for the quick response!

We tested against Alfresco One 5.0.0.5, Alfresco CE 5.0.a and Alfresco CE 5.0.c and we always got the same error.
We even tested commenting the problematic code and then the synchronization passed without any errors.

In my opinion the problem is caused by null NameChecked object. There is a public method setNameChecker() in ChainingUserRegistrySynchronizer but I didn't look for the code responsible for calling it.

Regards,
Stoyan

afaust
Legendary Innovator
Legendary Innovator
Hello,

the nameChecker is set via declarative Spring bean configuration in the Synchronization subsystem - there is no code that directly calls it. By any chance, do you have an addon installed that may have modified the synchronizer configuration? Or did you keep an old customization file (in extension directory) from 4.2 around?

Regards
Axel

stivek
Champ in-the-making
Champ in-the-making
Axel,

Your assumption regarding modification of synchronizer bean configuration was absolutely right. It appeared that there is a customization in our project that we inherited from another company that worked at our customer before us.
Adding
<property name="nameChecker" ref="nameChecker" />
to that custom bean definition made the synchronization working.

Many thanks,
Stoyan

mrogers
Star Contributor
Star Contributor
Yes, there is something strange going on that has not been described.