Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  Error on conversation api

    Posted 06-05-2025 18:10

    skansakar | 2016-08-31 11:30:50 UTC | #1

    I am running the following code but getting a null pointer exception. I am currently using Java SDK version 0.26.1.999 but this used to work on 0.19.1.66.

    Any ideas?

    ConversationsApi apiInstance = new ConversationsApi(); try { apiInstance.patchConversationIdParticipantsParticipantIdWithHttpInfo(conversationId, participantId, body); } catch (ApiException e) { ShipsLog.out.asError("Exception when calling ConversationsApi#patchConversationIdParticipantsParticipantId"); e.printStackTrace(); }

    2016-08-31 12:19:45,530 DEBUG [PureCloudChannelProvider] Performing call control action: ANSWER conversationId: 68ce30df-a334-4205-a10b-1ab8987540b6 participantId: 6eff8716-bf33-4f1f-95b8-0c8cc88b6eec 2016-08-31 12:19:45,692 TRACE EXCP:ExceptionOccured 2016-08-31 12:19:45,693 TRACE java.lang.NullPointerException at com.fasterxml.jackson.databind.type.TypeFactory.constructType(TypeFactory.java:576) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2798) at com.mypurecloud.sdk.ApiClient.invokeAPIVerbose(ApiClient.java:638) at com.mypurecloud.sdk.ApiClient.invokeAPI(ApiClient.java:700) at com.mypurecloud.sdk.api.ConversationsApi.patchConversationIdParticipantsParticipantIdWithHttpInfo(ConversationsApi.java:2598)


    skansakar | 2016-08-31 19:01:12 UTC | #2

    @tim.smith Any idea on what could be wrong with this?

    I get a similar error when I try to do a transfer. Am I missing something?

    2016-08-31 14:11:31,322 TRACE java.lang.NullPointerException at com.fasterxml.jackson.databind.type.TypeFactory.constructType(TypeFactory.java:576) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2798) at com.mypurecloud.sdk.ApiClient.invokeAPIVerbose(ApiClient.java:638) at com.mypurecloud.sdk.ApiClient.invokeAPI(ApiClient.java:700) at com.mypurecloud.sdk.api.ConversationsApi.postConversationIdParticipantsParticipantIdReplaceWithHttpInfo(ConversationsApi.java:3526) at com.verint.interactionManager.providers.inin.purecloud.api.calls.ConversationAPICall.postConversationIdParticipantsParticipantIdReplace(ConversationAPICall.java:169)


    tim.smith | 2016-08-31 19:09:28 UTC | #3

    That looks like API-1898. If there's no response body, the code that tries to parse it is still executed. There is no body, hence the NPE. This exception can be ignored for now.


    skansakar | 2016-08-31 19:17:53 UTC | #4

    Do you know when this is likely to be fixed? It is causing my app to crash out. :worried:

    I will try it again but I think I was getting the error even when I executed the methods without 'WithHttpInfo'.

    Is there anyway I will be able to see details of API-1898?


    skansakar | 2016-08-31 21:47:26 UTC | #5

    @tim.smith I get the same error when I change my code to:

    ConversationsApi apiInstance = new ConversationsApi(); try { apiInstance.patchConversationIdParticipantsParticipantId(conversationId, participantId, body); } catch (ApiException e) { ShipsLog.out.asError("Exception when calling ConversationsApi#patchConversationIdParticipantsParticipantId"); e.printStackTrace(); }


    tim.smith | 2016-08-31 21:51:20 UTC | #6

    I would expect that. The basic methods just call the WithHttpInfo version behind the scenes and return just the parsed type.

    I'm planning to have this fixed this week.


    tim.smith | 2016-09-02 21:35:08 UTC | #7

    This should be fixed in the latest version: 0.27.1.78. Let me know if you have issues still.


    skansakar | 2016-09-03 16:34:56 UTC | #8

    I tried the latest sdk version: 0.27.1.78 but it does not look like this is fixed yet. Unfortunately, I am getting the same error.

    2016-09-03 17:20:32,651 DEBUG [PureCloudChannelProvider] Performing call control action: ANSWER conversationId: f083af9b-8b72-46fd-8040-036b2c602dfd participantId: 34bf9cc8-b9a4-4953-9a36-812f6a7e10e9 2016-09-03 17:20:32,805 TRACE EXCP:ExceptionOccured 2016-09-03 17:20:32,805 TRACE java.lang.NullPointerException at com.fasterxml.jackson.databind.type.TypeFactory.constructType(TypeFactory.java:576) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2798) at com.mypurecloud.sdk.ApiClient.invokeAPIVerbose(ApiClient.java:629) at com.mypurecloud.sdk.ApiClient.invokeAPI(ApiClient.java:691) at com.mypurecloud.sdk.api.ConversationsApi.patchConversationIdParticipantsParticipantIdWithHttpInfo(ConversationsApi.java:3074) at com.verint.interactionManager.providers.inin.purecloud.api.calls.ConversationAPICall.updateParticipant(ConversationAPICall.java:47) at com.verint.interactionManager.providers.inin.purecloud.api.calls.ConversationAPICall.makeConversationActionCall(ConversationAPICall.java:434)


    skansakar | 2016-09-05 12:46:45 UTC | #9

    @tim.smith Also, will it not be better if there was a response all the time?? It would mean that we can check the response code on the HttpInfo as well as all API responses will be consistent?


    tim.smith | 2016-09-06 14:31:22 UTC | #10

    I figured out what's causing this. Working on a fix for today.


    skansakar | 2016-09-06 14:53:34 UTC | #11

    Great! Thanks :slight_smile:


    tim.smith | 2016-09-06 16:43:54 UTC | #12

    Version 0.28.1.80 is live now and contains two fixes:

    • API-1911 - Do not parse bodies when there isn't supposed to be one
    • API-1912 - return ApiResponse object for WithHttpInfo methods with no return type

    skansakar | 2016-09-06 20:23:16 UTC | #13

    Yes, I can confirm that the fix is working :smiley:


    system | 2017-08-28 19:26:49 UTC | #14


    This post was migrated from the old Developer Forum.

    ref: 343