Share via

ICallback<Void> as a callback for DELETE request

Polach, Daniel 1 Reputation point
2022-06-29T07:22:48.167+00:00

Hi,

com.microsoft.graph.http.CustomRequest#delete(com.microsoft.graph.concurrency.ICallback<java.lang.Void>) method expects com.microsoft.graph.concurrency.ICallback<java.lang.Void> as a parameter, but when you provide it, it throws an exception when processing the result, because it tries to cast com.google.gson.JsonObject to java.lang.Void, which is not possible.

Exception in thread "pool-1-thread-1" java.lang.ClassCastException: com.google.gson.JsonObject cannot be cast to java.lang.Void  

Therefore, it's not possible to provide callback methods for success and failure. Is there any workaround, or is it a bug, which is worked on?

Regards,
Dan

Microsoft 365 and Office | SharePoint | Development
Microsoft Security | Microsoft Graph

1 answer

Sort by: Most helpful
  1. Tong Zhang_MSFT 9,261 Reputation points
    2022-06-30T02:52:59.983+00:00

    Hi @Polach, Daniel ,

    Our forum mainly discuss about SharePoint development using C#, as your issue is about JAVA, we suggest you create a new thread on techcommunity for help.

    techcommunity :

    https://techcommunity.microsoft.com/t5/sharepoint-developer/bd-p/SharePointDev


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.