JAVA EWS item. Load throws request failed Still assign connections

I hope someone can help me

This is the code snippet that threw the exception:

if (mailList != null){
                for (Item item : mailList.getItems()){      
                    synchronized (item) {
                        es = Utils.initiateExchangeService(mailAccountData);
                        em = EmailMessage.bind(es,item.getId(),emPropSet);
                        item.load(new PropertySet(BasePropertySet.FirstClassProperties));

The line that throws the exception is: item load(new PropertySet(BasePropertySet.FirstClassProperties));

I know that this exception is usually thrown when we use the same instance of the exchangeservice class, but not here

Thank you for any help

Solution

So far, the only solution seems to be to use a single exchange service instance and synchronize access to it (only one thread is allowed at a time)

https://github.com/OfficeDev/ews-java-api/issues/276

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>