We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Error when trying to sort by "from"

Hello,

we are trying to load emails sorted from an exchange server. We are using the builder with following code:

builder.getFrom().orderBy(true)
client.listMessagesByPage(folderUri, builder.getQuery(), 50).getItems();

We get an Exception:

class com.aspose.email.system.exceptions.KeyNotFoundException: The given key was not present in the dictionary.
com.aspose.email.system.collections.generic.Dictionary.get_Item(Unknown Source)
com.aspose.email.zpt.a(SourceFile:7514)
com.aspose.email.zpt.b(SourceFile:7464)
com.aspose.email.zpt.a(SourceFile:7396)
com.aspose.email.zpt.a(SourceFile:7270)
com.aspose.email.zpt.a(SourceFile:7229)
com.aspose.email.zpt.a(SourceFile:7210)
com.aspose.email.zpt.a(SourceFile:8621)
com.aspose.email.zpt.listMessagesByPage(SourceFile:8480)

It does work for
builder.getSubject().orderBy(true)
and
builder.getInternalDate().orderBy(true)

Can you fix this? It’s not our fault as far as we can see, since we don’t do anything different with the “getFrom()…” than with the other methods.

Thank you very much,

Sigur

@sigur

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input email file.
  • Please create a simple application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Hello Tahir Manzoor,

thank you for the reply, we now have the Project you required: aspose.zip (1.3 KB)

In the zip there is a error.txt documenting the output and a Main.java, which when executed is producing the error. We cannot supply you with input email files, since we have encountered the error with several internal email accounts with Exchange Server 2010. Whoever recreating this will have to recreate it on his/her own Exchange Testmachine. It does also throw the error when the inbox is empty, but only with the mentioned method.

Thank you for your help, we hope you can fix it.

Best Wishes - Sigur

@sigur

We have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as EMAILJAVA-34973. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

1 Like