I am trying to connect to Box and get all Enterprises users by using
BoxUser.getAllEnterpriseUsers(api, userId, fields);
where api is BoxAPIConnection with (accessTOken, refreshToken, baseURL, baseploadURL, autoRefresh, lastRefresh, expires, tokenURL, clientID and clientSecret)
that is returning RunTimeException at com.box.sdk.BoxAPIRequest (line 468).
I was trying to debug and see where it's going wrong. My application is running with no issues on production. When I try to use the boxState locally it isn't working. Can someone please help fixing this.
BoxUser.Info getBoxUserInfo(String userId,
Predicate<BoxUser.Info> onLoginFilter, String... fields) {
if (api != null) {
try {
info = Iterables.get(
Iterables.filter(BoxUser.getAllEnterpriseUsers(api,
userId, fields), onLoginFilter), 0);
} catch(IndexOutOfBoundsException e) {
logger.warn("Failed to find box account for user {}!", userId);
} catch (BoxAPIResponseException e) {
logger.warn("Box call returned status {}", e.getResponseCode(), e);
logger.debug("api = {}, userId = {}, fields = {}", api, userId, Arrays.toString(fields));
}
}
}
702230 [http-nio-8080-exec-1] DEBUG
e.i.t.broker.box.BaseBoxUser - BaseBoxUser::getBoxUserInfo:api =
com.box.sdk.BoxAPIConnection@75ee2be5, userId = gad02, fields =
[id, login, status, modified_at, created_at], onLogFilter =
BaseBoxUser$2@3f707380
702286 [http-nio-8080-exec-1] ERROR o.a.c.c.C.[.[.[.
[dispatcherServlet] - Servlet.service() for servlet
[dispatcherServlet] in context with path [] threw exception
[Request processing failed; nested exception is
java.lang.RuntimeException] with root cause
java.lang.RuntimeException: null
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:468)
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:400)
at com.box.sdk.JsonIterator.loadNextPage(JsonIterator.java:68)
at com.box.sdk.JsonIterator.loadNextJsonObject(JsonIterator.java:102)
at com.box.sdk.JsonIterator.hasNext(JsonIterator.java:29)
at com.box.sdk.BoxUserIterator.hasNext(BoxUserIterator.java:21)
at com.google.common.collect.Iterators$5.computeNext(Iterators.java:635)
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
at com.google.common.collect.Iterators.get(Iterators.java:800)
at com.google.common.collect.Iterables.get(Iterables.java:729)
at edu.illinois.tech.broker.box.BaseBoxUser.getBoxUserInfo(BaseBoxUser.java:123)
at edu.illinois.tech.broker.box.BoxUserServiceStatus.getUserAccountInformation(BoxUserServiceStatus.java:47)
at edu.illinois.tech.broker.webapi.UserResource.getResource(UserResource.java:242)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Thanks, Pbale