Extracting message using EWS throws exception "2 CR found"(Java)

Hi team,
I am extracting messages using EWS client but sometimes in the middle of extraction it throws Exception :
Message Saving Error ::class com.aspose.email.system.exceptions.WebException: 2 CR found
com.aspose.email.internal.o.ze.b(Unknown Source)
com.aspose.email.internal.o.ze.c(Unknown Source)
com.aspose.email.internal.o.ze.a(Unknown Source)
com.aspose.email.internal.o.ze.b(Unknown Source)
com.aspose.email.internal.o.zbh.a(Unknown Source)
com.aspose.email.internal.o.zbi.invoke(Unknown Source)
com.aspose.email.system.zd.a(Unknown Source)
com.aspose.email.internal.ex.zc.a(Unknown Source)
com.aspose.email.internal.ah.zg.run(SourceFile:66)
java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
java.util.concurrent.FutureTask.run(Unknown Source)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)

How do i deal with that ?, one more thing while extracting mails it consumes too much memory, is there any better way to extracting mails from EWS account

@pradeepnegi,

Can you please share complete working sample project along with source file so that we may further investigate to help you out.

Sir i can’t share sample project, This Exception occurs randomly, sometimes it occurs and sometimes not. can you tell what is the cause of this exception so that i can handle it.

@pradeepnegi,

I have observed the stack trace shared by you and regret to share that without provision of access to test account and sample project, we may not be able to investigate the root cause of this randomly occurring issue and helping you further. Therefore, we request you to please provide requested information so that we may help you further in this regard.

This is the demo Project Jar for this issue , Please run this jar from command prompt (cmd) so that you can get the Exception.
https://drive.google.com/open?id=17fJUGLr28H2ppA-LS39Laqx9zUMH7tdu

@pradeepnegi,

I have tried executing the Jar file shared by you using Aspose.Email for Java 19.5 on my end. I have obtained different exception on my end as shared in following image. However, instead of JAR file, we need to have a sample code and access to test account with which you are able to reproduce the issue. We really wish to help you further and need requested inforamtion from you.

Demo.zip (1003 Bytes)

@pradeepnegi,

Thank you very much for sharing requested information. Appreciate your cooperation in this regard. I have tried to execute the shared example code with given credentials on my end and it failed to connect via client. I am getting below exception on connecting.

Moreover, when i directly tired to access the outlook using browser, it too gave error using provided credentials. Can you please check this on your end.

I have checked this code , it’s working in my system, try this code : Demo.zip (1.0 KB)

@pradeepnegi,

I have tried working with new sample shared by you and result is the same. The issue seems to be with user name and password. Can you please verify this on your end as I am getting 404 exception and also even through browser the shared credentials don’t work.

This account is Outlook account, can you check this account in oulook.com

@pradeepnegi,

There seems to be some account access issue and for that reason, I am unable to access that. Please check following image for your reference that is not allowing me to access shared account owing to security reason and asking for security code.

Can you please fix then and share with us.

so can you tell me how can i give you another account.

@pradeepnegi,

You may share account details and than remove extra security layers of your account so that we may access your account to further investigate to help you out.

This text will be hidden

Summary

Sysdemo123@hotmail.com
S@12345678

@pradeepnegi,

Thank you for sharing the new account details with us. I have tried using provided sample code on my end using Aspose.Email for Java 19.5 in Windows 7 VM. I have obtained following output on my end and with no issue incurring.

Downloading all messages from Inbox…
Root\13-06-2019 12-40
0
Root\13-06-2019 12-40\Sysdemo12@hotmail.com
0
Root\13-06-2019 12-40\Sysdemo12@hotmail.com\Inbox
11
Abx and another event today.
“Microsoft Outlook Calendar” no-reply@microsoft.com

Kernel Exchange Suite
“Amber Saxena” ambers@crm.kerneldatarecovery.com

Download Confirmation/Kernel Exchange Suite
“Amber Saxena” ambers@crm.kerneldatarecovery.com

Abx and another event today.
“Microsoft Outlook Calendar” no-reply@microsoft.com

Abx and another event today.
“Microsoft Outlook Calendar” no-reply@microsoft.com

Busy(Aspose.Email Evaluation) and another event today.
“Microsoft Outlook Calendar” no-reply@microsoft.com

Today: Busy(Aspose.Email Evaluation)
“Microsoft Outlook Calendar” no-reply@microsoft.com

Today: Busy(Aspose.Email Evaluation)
“Microsoft Outlook Calendar” no-reply@microsoft.com

Busy(Aspose.Email Evaluation) and another event today.
“Microsoft Outlook Calendar” no-reply@microsoft.com

One or more of the folders in your mailbox are named incorrectly.
“Microsoft Outlook” postmaster@outlook.com

“Golden, Carly A” Carly.Golden@providence.org

Root\13-06-2019 12-40\Sysdemo12@hotmail.com\Inbox\Test Folder
0

Sir, I have told you this exception occurs randomly, sometimes it appears and sometimes not, Generally.

@pradeepnegi,

I have not been able to reproduce the issue on number of iterations. However, an issue with ID EMAILJAVA-34554 has been created in our issue tracking system as investigation to further investigate and resolve the issue. This thread has been linked with issue so that you may be notified once the issue will be fixed.