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

Free Support Forum - aspose.com

Exception: ArgumentOutOfRangeException on adding calender event to PST(Java)

I’m trying to add calendar event to PST (attached event).
And getting this exception:

Exception in thread “main” class
com.aspose.email.system.exceptions.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: Not a valid Win32 FileTime.
com.aspose.email.system.DateTime.toFileTimeUtc(Unknown Source)
com.aspose.email.system.DateTime.toFileTime(Unknown Source)

this is the code:

PersonalStorage pst = PersonalStorage.create("/tmp/calendar.pst", FileFormatVersion.Unicode);
FolderInfo tmpFolder = pst.createPredefinedFolder(“Calendar”, StandardIpmFolder.Appointments);
MapiConversionOptions options = new MapiConversionOptions(OutlookMessageFormat.Unicode);
Appointment app = Appointment.load(Files.newInputStream(Paths.get("/tmp/event.ical")));
final MailMessage msg = new MailMessage();
final MapiMessage mapi = MapiMessage.fromMailMessage(msg, options);
final MapiCalendar tmpCal = (MapiCalendar) mapi.toMapiMessageItem();

Please advise.

event.ical.zip (922 Bytes)


I have observed the issue shared by you and request you to please provide Java and Operating System details on your end. Please also confirm that have you tried using latest Aspose.Email for Java 19.6 on your end to verify the issue or not.

Well, I’m using custom version of 19.5.2 that you provided me for multi-thread fix and question if those fixes are included into 19.6 ?
As for OS and Java, is CentOS and Java 8.



I have worked with source code and file shared by you and unable to observe any issue. I used Aspose.Email 19.6 on my end. I have also shared my generated result with you for your kind reference.calendar.zip (10.7 KB)

As I said I’m using your custom build that you’re provided to us for multi-thread issue debugging, so is 19.6 contains all fixes that were made to 19.5.2 ?


Yes, the official release Aspose.Email for Java 19.6 does include the fixes shared in Aspose.Email for Java 19.5.1.

Well, I tried to work with 19.6 version and it has same errors that 19.5.2 fixed, so it’s regression.
Please advise


We are internally verifying the issue on our end and will share feedback with you as soon as possible. As you have shared that issue is reproduced in Aspose.Email for Java 19.6, then things will likely to be included in Aspose.Email for Java 19.7 and in mean time, you may please continue to use hotfix shared earlier.

I have to say that 19.6 indeed solves com.aspose.email.system.exceptions.ArgumentOutOfRangeException exception, but it’s reverted fix that you did in 19.5.2 (custom build for us to solve multi-thread issues).
This is stack trace from 19.6:

at com.aspose.email.internal.d.zd.a(Unknown Source)
at com.aspose.email.internal.d.zc.a(Unknown Source)
at com.aspose.email.internal.d.zc.removeItem(Unknown Source)
at com.aspose.email.zada.b(SourceFile:76)
at com.aspose.email.zbaq.c(SourceFile:573)
at com.aspose.email.zbaq.a(SourceFile:472)
at com.aspose.email.zbaq.b(SourceFile:513)
at com.aspose.email.zfz.a(SourceFile:1242)
at com.aspose.email.zfz.a(SourceFile:1170)
at com.aspose.email.zfz.k(SourceFile:896)
at com.aspose.email.zfz.a(SourceFile:202)
at com.aspose.email.CalendarWriter.write(SourceFile:173)
at com.aspose.email.Appointment.a(SourceFile:996)
at com.aspose.email.Appointment.requestApointment(SourceFile:937)
at com.aspose.email.Appointment.requestApointment(SourceFile:922)



I am sorry, I have not been able to understand the point. Can you please share a working example that is failing on your end using latest version and what is expected response.

I’ll try to rephrase.
There’s a topic Strange exception when adding sub folder in pst
That I created which ia talking about multi threading issue. You provided me custom build (19.5.2) to see if it’s helps. And indeed 19.5.2 fixed, but then I got OutOfRnage exception and your guys suggest me to try 19.6. When I tried 19.6 in single thread environment it’s worked fine and fix OutOfRnage exception, but 19.6 brought back multi threading issue, that is discussed in topic : Strange exception when adding sub folder in pst
That’s all.


For multi-threading related issue, I have already associated the shared information with concerned ticket in our issue tracking system yesterday. I request you to please follow the following thread to deal with issue of Multi-threading using Aspose.Email for Java 19.6.


We have fixed issues related to InvalidOpeationException and NullPointerException on our end in special hotfix for you. It also include fix for one of your this old issue as well.

Thanks a lot !!! Will start using it and let you know about any findings.


You are very welcome.

Seems that is working fine with multi-threading issues and with other issues as well,
Will next official version include all fixes fro ?


Sure, next release will fix all issues.

We still see exceptions like that :
at com.aspose.email.zalt.d(SourceFile:2536)
at com.aspose.email.zalt.b(SourceFile:307)
at com.aspose.email.zalt.e(SourceFile:1374)
at com.aspose.email.zaed.a(SourceFile:1468)
at com.aspose.email.zaln.b(SourceFile:175)
at com.aspose.email.zaed.n(SourceFile:1613)
at com.aspose.email.zaqv.h(SourceFile:1262)
at com.aspose.email.FolderInfo.addMessage(SourceFile:742)
at com.aspose.email.FolderInfo.addMapiMessageItem(SourceFile:858)

In version 19.6.2 that you provided us when running in multithreaded environment. Seems that issue is not completely solved.
Please advise.


Can you please try Aspose.Email 19.10 on your end. In case the issue is still reproduced, please share the necessary details along with sample project reproducing the issue. Actually, as per special hotfix shared with you, the issue was resolved and ideally ported to subsequent releases.

Sure will try, but please reqd entire thread before you asking for additional details and samples. This should help you to understand the issue and to not spent your and my time on irrelevant questions.