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

Free Support Forum - aspose.com

SplitAndMergePSTFile NullPointerException

I have been trying to run the sample

SplitAndMergePSTFile and I always receive NullPointerException when executing method mergeMultiplePSTsIntoASinglePST() executing the pst.mergeWith(fileNames)

has anyone experienced this before

same thing happens executing the method mergeFoldersFromAnotherPST()

when the statement is executed destinationFolder.mergeWith(sourceFolder) NullPointerException is also thrown

Hi Don,


We are sorry for the inconvenience you are facing.

Could you please provide a complete stack trace of the exception you are getting? We executed the code manually at our end by copying it in Eclipse project and providing sample PST files which resulted in proper working of the functionality. Please also make sure that the sample file exists at the source location and let us know your feedback.

I am using aspose-email-16.10.0-jdk16.jar
and Java:jdk1.6.0_13

Exception in thread “main” java.lang.NullPointerException
at com.aspose.email.auj$d.hasNext(SourceFile:1250)
at com.aspose.email.amr$a.hasNext(SourceFile:3412)
at com.aspose.email.FolderInfo.mergeWith(SourceFile:1006)
at com.aspose.email.PersonalStorage.a(SourceFile:1259)
at com.aspose.email.PersonalStorage.mergeWith(SourceFile:1068)
at com.aspose.email.examples.outlook.pst.SplitAndMergePSTFile.mergeMultiplePSTsIntoASinglePST(SplitAndMergePSTFile.java:98)
at com.aspose.email.examples.outlook.pst.SplitAndMergePSTFile.main(SplitAndMergePSTFile.java:33)

Hi Don,


We have tested the sample code and were not able to face any exception as you have mentioned. The issue seems specific to the test.pst file which, unfortunately, is corrupt itself as we are also not able to open it in MS Outlook. Please try it with a different PST file and let us know your feedback.

I did try a couple of the different PSTs that were packed with the samples and was able to merge them

thanks for your quick reply

I was able to open the test.pst in outlook the messages were available to me. seems to be something with the calendar items that was bad.

I see where there is logging class in the Aspose api however it is not being used in any of the samples I will look into the logging some nore to hopefully identify things that may be in error

Hi Don,


Are you properly initializing license in your application? We have tested the issue and found that if license is not initialized, then we get a NullPointerException. Please try with initializing license in your application and let us know your feedback.

Thanks for your suggestion.



I was not loading the license for the sample. I was able to use the test.pst provided to merge with the other pst outlook.pst provided in the samples after it did load the license.

*** The storage is merging: {0}C:\AsposeTests\src\main\resources\outlook\Sources\Outlook.pst

Added 5 messages to Top of Personal Folders\Deleted Items

Added 3 messages to Top of Personal Folders\Inbox

Added 6 messages to Top of Personal Folders\Sent Items

Added 1 messages to Top of Personal Folders\Calendar

Total messages added: 16





However when trying to open with Outlook 2010 (our standard) there is a popup that says Errors have been detected in the file. This is the same test.pst that was opened previously before the merge which was giving the error with the calendar entry.



the reason I want to highlight Outlook 2010 is we have a vendor that has developed an application to generate PSTs for us however when they are opened in Outlook 2010 the messages are visible.



If there are calendar items in the PST that has been attached to Outlook when trying to open one it freezes Outlook 2010.



The vendor was using Outlook 2013 to verify the test results and reported that he is able to open the calendar items without issues.



It seems there are differences it the way that calendar entries in a PST are expected to be formatted from Outlook 2010 and Outlook 2013 that is causing the issue



I attached the zip of the PST that I merged in the sample code that I am having an issue opening in Outlook 2010

Hi Don,


We were able to reproduce this issue at our end even with merging of Outlook 2010 PST files and have logged it as EMAILJAVA-34211 for further investigation by our Product team. We’ll update you here once there is some information or a fix version available in this regard.
Is there a specific location that I can check on the status of , EMAILJAVA-34211

We are really in a bind trying to open Calendar items with Outlook 2010 using the PST generated from the aspose java api. which will crash the Outlook 2010 client when clicking on the calendar item.

Hi Don,


The issue tracking system is for internal use only and is available to Aspose Support team. The issue is currently pending for analysis by our Product team. We’ll update you here once there is some information available in this regard.

The issues you have found earlier (filed as EMAILJAVA-34210) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.