Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jans-config-api): GET configuser exception #2473

Closed
moabu opened this issue Sep 26, 2022 · 2 comments · Fixed by #2505
Closed

fix(jans-config-api): GET configuser exception #2473

moabu opened this issue Sep 26, 2022 · 2 comments · Fixed by #2505
Assignees
Labels
comp-jans-config-api Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality
Milestone

Comments

@moabu
Copy link
Member

moabu commented Sep 26, 2022

Request:
GET for /jans-config-api/mgt/configuser

Stacktrace:

26-09 14:56:15.490 INFO  jans.configapi.filters.LoggingFilter LoggingFilter.java:33- ****Request GET /configuser from IP 176.199.211.208
2022-09-26 14:56:15.497:WARN :oejs.HttpChannel:qtp762476028-13: handleException /jans-config-api/mgt/configuser com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.ArrayIndexOutOfBoundsException) (through reference chain: io.jans.configapi.plugin.mgt.rest.UserResource$UserPagedResult["entries"]->java.util.ArrayList[0]->io.jans.configapi.plugin.mgt.model.user.CustomUser["customAttributes"]->java.util.ArrayList[1]->io.jans.orm.model.base.CustomObjectAttribute["displayValue"])
@moabu moabu self-assigned this Sep 26, 2022
@mo-auto mo-auto added comp-jans-config-api Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality labels Sep 26, 2022
@moabu moabu assigned pujavs and unassigned moabu Sep 27, 2022
@pujavs
Copy link
Contributor

pujavs commented Sep 28, 2022

Working fine in LDAP but throwing the above error in MySQL. Attached logs and testing details
Analysing further
LDAP Testing with latest code:
image

MySQL Testing with latest code:
image

@moabu moabu added this to the 1.0.3 milestone Sep 29, 2022
@pujavs
Copy link
Contributor

pujavs commented Sep 29, 2022

Issue: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/java.util.Arrays$ArrayList.get(Arrays.java:4351)
at io.jans.orm.model.base.CustomObjectAttribute.getDisplayValue(CustomObjectAttribute.java:95)
at io.jans.configapi.plugin.mgt.rest.UserResource.getUsers(UserResource.java:111)
at io.jans.configapi.plugin.mgt.rest.UserResource$Proxy$_$$WeldSubclass.getUsers(Unknown Source)
at io.jans.configapi.plugin.mgt.rest.UserResource$Proxy$
$$_WeldClientProxy.getUsers(Unknown Source)

Complete Logs: 2022_09_29.jetty_error_2_complete.log

Analysis: CustomObjectAttribute values list attribute element accessed without checking length.

Fix: Added length check before accessing CustomObjectAttribute values list elements

Module: jans-orm module

Testing on My-SQL env:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-jans-config-api Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants