Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

Nullpointer Exception while downloading ItemAttachment

$
0
0

Hi,

Can someone help?

I am getting a nullpointer exception when i am loading the itemattachment.

if(atch instanceof ItemAttachment){

b = (ItemAttachment)atch;

PropertySet setprop = new PropertySet();
setprop.add(EmailMessageSchema.Attachments);
setprop.add(EmailMessageSchema.MimeContent);
setprop.add(ItemSchema.Attachments);
setprop.add(ItemSchema.MimeContent);

b.load(setprop);   ---->nullpointer exception here

}

error details:

java.lang.NullPointerException
at org.apache.commons.httpclient.HttpMethodBase.getStatusCode(HttpMethodBase.java:566)
at microsoft.exchange.webservices.data.HttpClientWebRequest.getResponseCode(HttpClientWebRequest.java:313)
at microsoft.exchange.webservices.data.ServiceRequestBase.validateAndEmitRequest(ServiceRequestBase.java:733)
at microsoft.exchange.webservices.data.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:36)
at microsoft.exchange.webservices.data.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:142)
at microsoft.exchange.webservices.data.ExchangeService.internalGetAttachments(ExchangeService.java:1590)
at microsoft.exchange.webservices.data.ExchangeService.getAttachment(ExchangeService.java:1640)
at microsoft.exchange.webservices.data.Attachment.internalLoad(Attachment.java:381)
at microsoft.exchange.webservices.data.ItemAttachment.load(ItemAttachment.java:191)


Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>