Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Concurrency Modification exception

pallavis8124480
Level 4
Level 4

I am getting concurrencyModificationException when I try to iterate through Authorizable.declaredMemberOf() which is OOTB.
The issue occurs intermittently and not always . I am not modifying the original list any where.  
Please let me know what should be done in this case.


Please see some stack trace here : 

Caused by: java.util.ConcurrentModificationException: null

        at java.util.HashMap$Ha**bleep**erator.nextNode(Unknown Source)

        at java.util.HashMap$KeyIterator.next(Unknown Source)

        at org.apache.jackrabbit.oak.security.authorization.permission.PermissionEntryProviderImpl.loadEntries(PermissionEntryProviderImpl.java:163) [org.apache.jackrabbit.oak-core:1.8.7]

        at org.apache.jackrabbit.oak.security.authorization.permission.PermissionEntryProviderImpl.getEntries(PermissionEntryProviderImpl.java:142) [org.apache.jackrabbit.oak-core:1.8.7]

        at org.apache.jackrabbit.oak.security.authorization.permission.CompiledPermissionImpl$TreePermissionImpl.getGroupEntries(CompiledPermissionImpl.java:579) [org.apache.jackrabbit.oak-core:1.8.7]

        at org.apache.jackrabbit.oak.security.authorization.permission.CompiledPermissionImpl$TreePermissionImpl.access$1400(CompiledPermissionImpl.java:459) [org.apache.jackrabbit.oak-core:1.8.7]

        at org.apache.jackrabbit.oak.security.authorization.permission.CompiledPermissionImpl$LazyIterator.getNext(CompiledPermissionImpl.java:624) [org.apache.jackrabbit.oak-core:1.8.7]

        at org.apache.jackrabbit.oak.security.authorization.permission.CompiledPermissionImpl$LazyIterator.getNext(CompiledPermissionImpl.java:589) [org.apache.jackrabbit.oak-core:1.8.7]

        at org.apache.jackrabbit.commons.iterator.AbstractLazyIterator.hasNext(AbstractLazyIterator.java:39) [org.apache.jackrabbit.jackrabbit-jcr-commons:2.16.3]

        at com.google.common.collect.Iterators$5.hasNext(Iterators.java:542)

        at org.apache.jackrabbit.oak.security.authorization.permission.CompiledPermissionImpl$TreePermissionImpl.canRead(CompiledPermissionImpl.java:531) [org.apache.jackrabbit.oak-core:1.8.7]

        at org.apache.jackrabbit.oak.core.SecureNodeBuilder$ReadablePropertyPredicate.apply(SecureNodeBuilder.java:384) [org.apache.jackrabbit.oak-core:1.8.7]

        at org.apache.jackrabbit.oak.core.SecureNodeBuilder.getProperty(SecureNodeBuilder.java:180) [org.apache.jackrabbit.oak-core:1.8.7]

        at org.apache.jackrabbit.oak.plugins.tree.impl.AbstractTree.getProperty(AbstractTree.java:251) [org.apache.jackrabbit.oak-core:1.8.7]

        at org.apache.jackrabbit.oak.core.MutableTree.getProperty(MutableTree.java:128) [org.apache.jackrabbit.oak-core:1.8.7]

        at org.apache.jackrabbit.oak.plugins.tree.TreeUtil.getStringInternal(TreeUtil.java:116) [org.apache.jackrabbit.oak-security-spi:1.8.7]

        at org.apache.jackrabbit.oak.plugins.tree.TreeUtil.getPrimaryTypeName(TreeUtil.java:88) [org.apache.jackrabbit.oak-security-spi:1.8.7]

        at org.apache.jackrabbit.oak.spi.security.user.util.UserUtil.isType(UserUtil.java:63) [org.apache.jackrabbit.oak-security-spi:1.8.7]

        at org.apache.jackrabbit.oak.security.user.AuthorizableBaseProvider.getByPath(AuthorizableBaseProvider.java:72) [org.apache.jackrabbit.oak-core:1.8.7]

     

1 Accepted Solution
Albin_Issac
Correct answer by
Community Advisor
Community Advisor

The same issue reported here -https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/concurrentmodificationexce...

 

Review and and see if this resolve the issue.

 

Regards

Albin I

 

View solution in original post

6 Replies
Albin_Issac
Correct answer by
Community Advisor
Community Advisor

The same issue reported here -https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/concurrentmodificationexce...

 

Review and and see if this resolve the issue.

 

Regards

Albin I

 

View solution in original post

pallavis8124480
Level 4
Level 4

Hi Albin,

 

I have visited the given link , but unfortunately it doesn't resolve my issue. 
 It gives the exception in OOTB classes when we are doing iterator.next() ,hence i am unsure about it.

 

Thanks,

Pallavi 

Albin_Issac
Community Advisor
Community Advisor

Please post the code used to iterate the details

 

Regards

Albin

Andrew_Khoury
Employee
Employee

@Albin_Issacif you look at the stack trace the the HashMap throwing the exception is from Apache Jackrabbit Oak code at org.apache.jackrabbit.oak.security.authorization.permission.PermissionEntryProviderImpl.loadEntries(PermissionEntryProviderImpl.java:163) [org.apache.jackrabbit.oak-core:1.8.7]

 

I filed an issue for this, if possible, please update with more details on the issue:

https://issues.apache.org/jira/browse/OAK-9117

pallavis8124480
Level 4
Level 4

@Albin_Issac  : 
The code iterates through user groups . 

User user = (User) userManager.getAuthorizable("userId");

Iterator<Group> groups = user.declaredMemberOf();
while (groups.hasNext()) {
Group group = groups.next();
//some logic goes here..
}

 

@Andrew_Khoury  : Thanks for creating a ticket. 
Yes ,the issue comes OOTB classes , so we are unable to trace it out.

Albin_Issac
Community Advisor
Community Advisor
@Andrew_Khoury thanks for the ticket, let me review and add if any additional details required