Legacy Dev Forum Posts

 View Only

Sign Up

Getting NPE When using NotificationListener

  • 1.  Getting NPE When using NotificationListener

    Posted 06-05-2025 18:19

    Rajagopal_Bojanapall | 2021-07-21 12:09:44 UTC | #1

    Hello I am using the code snippet mentioned here. Getting NPE when I called

    member.getJoined()

    I checked member is not null. Not sure what's the error. Printing the stacktrace. First 3 lines are my logging statements

    Queue id: 82c2f7e4-2ceb-4cab-ad43-3d81000a7cf6 Queue name: United Kingdom[PHONE QUEUE ONLY] Driver FunnelEnglish_Normal Event type: member left Member id: e00513f3-9541-4198-9d9d-d4f4c0c53f9c Membeer name: {} 2021-07-21 17:29:11,420 ERROR com.mypurecloud.sdk.v2.extensions.notifications.NotificationHandler - java.lang.NullPointerException at com.uber.co.insights.faas.common.source.SalesforceAgentQueueChangesSource$QueueMemberEventListener.onEvent(SalesforceAgentQueueChangesSource.java:92) at com.mypurecloud.sdk.v2.extensions.notifications.NotificationHandler$1.onTextMessage(NotificationHandler.java:135) at com.neovisionaries.ws.client.ListenerManager.callOnTextMessage(ListenerManager.java:352) at com.neovisionaries.ws.client.ReadingThread.callOnTextMessage(ReadingThread.java:262) at com.neovisionaries.ws.client.ReadingThread.callOnTextMessage(ReadingThread.java:240) at com.neovisionaries.ws.client.ReadingThread.handleTextFrame(ReadingThread.java:965) at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:748) at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:110) at com.neovisionaries.ws.client.ReadingThread.run(ReadingThread.java:66)

    Can you help ?


    John_Carnell | 2021-07-21 13:17:37 UTC | #2

    Hi Raj.

    I will see if we can get someone on the developer engagement to take a look at this.

    Thanks, John Carnell Manager, Developer Engagement


    anon11147534 | 2021-07-21 16:35:56 UTC | #3

    Hi Raj,

    I've been looking into this problem.

    It appears that there is a bug in the notification service and for every membership event, two messages are sent in quick succession. One contains the joined boolean, the other doesn't. The resulting exception from calling member.getJoined() on the message without the joined boolean is handled by the notification handler and logged using the default logger. It can safely be ignored.

    I have reported this issue to the relevant team and they will work to resolve it.

    Thanks for reporting, Ronan


    Rajagopal_Bojanapall | 2021-07-22 05:15:12 UTC | #4

    Thank you @anon11147534 for the quick reply.

    Let me know on this post when the fix has been deployed.


    system | 2021-08-22 05:15:14 UTC | #5

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 11530