Error Extracting Calendar events from PST - Java

I have the following (simplified for the sake of this post) code which attempts to extract messages from a PST to EML:


private void extractEmlFile(FolderInfo folderInfo, PersonalStorage pst) {

MessageInfoCollection messageInfoCollection = folderInfo.getContents();

MessageInfo messageInfo = (MessageInfo) messageInfoCollection.get(0);

MapiMessage message = pst.extractMessage(messageInfo);

MailMessageInterpretorFactory.getInstance().getIntepretor(message.getMessageClass()).interpret(message).save("my_eml_file.eml",MessageFormat.getEml());

}

When this code encounters a Calendar event I get the following error:


java.lang.NullPointerException
at com.aspose.email.bO.a(Unknown Source)
at com.aspose.email.bO.(Unknown Source)
at com.aspose.email.MapiCalendar.a(Unknown Source)
at com.aspose.email.MapiCalendar.e(Unknown Source)
at com.aspose.email.MapiCalendar.a(Unknown Source)
at com.aspose.email.AppointmentMailMessageInterpretor.interpret(Unknown Source)
at com.emlextract.AsposeMessageConverter.extractEmlFile(AsposeMessageConverter.java:154)


I'm currently using Aspose Email for Java version 3.1.0.0 (aspose-email-3.1.0.0-jdk16.jar).

Am I doing something wrong or is this a bug? Is it fixed in a future release?


Hi David,


Thank you for posting your query.

It seems the issue is due to the old version of Aspose.Email for Java as I was unable to face any issue while saving the appointment items as EML. Please try it with the latest version of Aspose.Email for Java 5.2.0 and share your feedback with us. If you still face any issue, please share your sample PST file with us. We shall look into it for further investigation.

I’ve upgraded to the newest version and my previous NullPointerException is now gone, but I am still seeing a couple of errors. I’ll create a new post as I don’t believe they are related to Calendar events.

Hi David,

Thank you for upgrading to the latest version. We shall assist you further for your queries as you post these in forum.