Hallo, when I press "Show all users" app arises an java NullPointer exception error
Asked by Damir Hohnjec:

### Cause {#toc-hId-1596788385}

java.lang.NullPointerException  
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:210)

#### Stack Trace:\[hide\] {#toc-hId--1151882081}

```
java.lang.NullPointerException	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:210)	at com.google.common.collect.ImmutableCollection$ArrayBasedBuilder.add(ImmutableCollection.java:339)	at com.google.common.collect.ImmutableList$Builder.add(ImmutableList.java:652)	at com.google.common.collect.ImmutableList$Builder.add(ImmutableList.java:630)	at com.google.common.collect.ImmutableCollection$Builder.addAll(ImmutableCollection.java:282)	at com.google.common.collect.ImmutableCollection$ArrayBasedBuilder.addAll(ImmutableCollection.java:360)	at com.google.common.collect.ImmutableList$Builder.addAll(ImmutableList.java:665)	at com.atlassian.confluence.api.model.pagination.PageResponseImpl$Builder.addAll(PageResponseImpl.java:164)	at com.atlassian.confluence.api.model.pagination.PageResponseImpl.from(PageResponseImpl.java:80)	at com.atlassian.confluence.api.impl.pagination.PaginationServiceImpl.executeBatch(PaginationServiceImpl.java:173)	at com.atlassian.confluence.api.impl.pagination.PaginationServiceImpl.lambda$doRequestInTransaction$2(PaginationServiceImpl.java:157)	at com.atlassian.confluence.api.impl.ReadOnlyAndReadWriteTransactionConversionTemplate.lambda$executeInReadOnly$0(ReadOnlyAndReadWriteTransactionConversionTemplate.java:48)	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)	at com.atlassian.confluence.api.impl.ReadOnlyAndReadWriteTransactionConversionTemplate.executeInReadOnly(ReadOnlyAndReadWriteTransactionConversionTemplate.java:48)	at com.atlassian.confluence.api.impl.pagination.PaginationServiceImpl.doRequestInTransaction(PaginationServiceImpl.java:139)	at com.atlassian.confluence.api.impl.pagination.PaginationServiceImpl.doPaginationListRequest(PaginationServiceImpl.java:71)	at com.atlassian.confluence.internal.user.UserSearchServiceInternalImpl.doUserSearch(UserSearchServiceInternalImpl.java:70)	at com.atlassian.confluence.user.actions.AbstractSearchCrowdUsersAction.doUserSearch(AbstractSearchCrowdUsersAction.java:98)	at com.atlassian.confluence.user.actions.BrowseUsersAction.execute(BrowseUsersAction.java:9)
```


Answers:
author: Suren Raj
body: Hi, Damir.  

According to the error shown, It's most likely due to Confluence can't build pagination View All Users Page. As a troubleshooting step, here's what I'd like you to Rebuild the Content Indexes From Scratch on Confluence Server:  

* <https://confluence.atlassian.com/confkb/how-to-rebuild-the-content-indexes-from-scratch-110035351.html>

If rebuilding the index doesn't help, please remove the current external user directory and re-create it. See [Confluence triggers NPE when a user tries to open View All Users](https://confluence.atlassian.com/display/CONFKB/Confluence+triggers+NPE+when+a+user+tries+to+open+View+All+Users?utm_source=hercules&utm_medium=comment&utm_campaign=802597745)for more information.

* <https://confluence.atlassian.com/confkb/confluence-triggers-npe-when-a-user-tries-to-open-view-all-users-802597745.html>

Cheers

comments: author: Damir Hohnjec
body: Hi, thank's, I have to remove an external user directory, and the app shows me now correctly one user (admin) without exception. When I try to add another, on top of the screen, is shown:  
Uses allowed by the license: 10  
Current active users: 10

which is not correct and I can'tadd another! Any ideas what to do now?  
greeting,

Damir Hohnjec


author: Suren Raj
body: Hi, Damir.

Please follow the below and check for active users counting towards the Confluence license:  
\* <https://confluence.atlassian.com/confkb/how-to-get-a-list-of-active-users-counting-towards-the-confluence-license-298978076.html>

Cheers


author: Damir Hohnjec
body: Hi, Suren.

Reindexing Content has recovered Users count, but all of my problems were caused because someone has renamed setting from Confluence in Jira SD! After recovering this everything was working fine. Thank you for your time with best wishes,

Damir Hohnjec

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/18239i9B32D5756A1D3223/image-size/large?v=v2&px=999 "image.png")


author: Damir Hohnjec
body: PS.NullPointer exception Bug for "Show users..." still arises when "User Diectory" is pointed to **unexisting** host/application!