OfficeDev / ews-java-api

A java client library to access Exchange web services. The API works against Office 365 Exchange Online as well as on premises Exchange.
MIT License
870 stars 560 forks source link

microsoft.exchange.webservices.data.ServiceResponseException: Object cannot be deleted #302

Open aquav opened 9 years ago

aquav commented 9 years ago

Hi We are using ews-java-api version 1.2. We are getting this exception on deletion of email during load test. Our application perform four steps:- 1) Read email 2) Process them (downloading attachment etc) 3) Send an automated Response 4) Delete emails

We have observed that during load test, where we have processed almost 4000 emails in 4 hours with variation of 300 emails/hr to 1500 emails/hr. we have started receiving this exception on last hour and just after step 3 i.e. after sending the response. All emails sent on first 3 hours were deleted successfully.

Also we were running this load test from 4 threads concurrently.

Here is exception trace:-

Caused by: microsoft.exchange.webservices.data.ServiceResponseException: Object cannot be deleted.
    at microsoft.exchange.webservices.data.ServiceResponse.internalThrowIfNecessary(ServiceResponse.java:266) ~[ews-api-1.2.3.jar:na]
    at microsoft.exchange.webservices.data.ServiceResponse.throwIfNecessary(ServiceResponse.java:254) ~[ews-api-1.2.3.jar:na]
    at microsoft.exchange.webservices.data.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:152) ~[ews-api-1.2.3.jar:na]
    at microsoft.exchange.webservices.data.ExchangeService.internalDeleteItems(ExchangeService.java:1472) ~[ews-api-1.2.3.jar:na]
    at microsoft.exchange.webservices.data.ExchangeService.deleteItem(ExchangeService.java:1523) ~[ews-api-1.2.3.jar:na]
    at microsoft.exchange.webservices.data.Item.internalDelete(Item.java:192) ~[ews-api-1.2.3.jar:na]
    at microsoft.exchange.webservices.data.Item.delete(Item.java:328) ~[ews-api-1.2.3.jar:na]

I don't see any issue in application or ews code. I am assuming there might be a limit on hard delete in a certain time range set by exchange. I will check with exchange admin and update here, if I get an answer.

Please help if you have any experience facing this issue. Thanks in advance.

serious6 commented 9 years ago

@aquav thanks for the report. It would also be interesting if this error also occurs when you run your load test against the current 2.0 api.

shiroikumakoori commented 2 years ago

Hi, I am facing this same error as well, using version 2.0.

For our case, after a linux patching on our servers, one of our mailboxes were unable to delete its mails with this error appearing, another mailbox seems to be able to delete.

Sorry I can't post the logs due to data restriction policy in my company, but our logs are similar to OP's apart from the stack trace which we did not log. Would greatly appreciate any clues/help on this, thanks!