Error on conversation api

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)

@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)

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.

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?

@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();
    	}

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.

1 Like

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

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)

@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?

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

Great! Thanks :slight_smile:

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
1 Like

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

1 Like