com.aspose.email.system.exceptions.ArgumentOutOfRangeException: Specified argument was out of the range of valid values


#1

Hi,
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)
com.aspose.email.MapiProperty.a(SourceFile:1145)
com.aspose.email.MapiProperty.a(SourceFile:1065)
com.aspose.email.MapiPropertyContainer.a(SourceFile:759)
com.aspose.email.MapiMessage.a(SourceFile:3652)
com.aspose.email.MapiMessage.e(SourceFile:2945)
com.aspose.email.MapiMessage.fromMailMessage(SourceFile:1541)

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();
msg.addAlternateView(app.requestApointment());
final MapiMessage mapi = MapiMessage.fromMailMessage(msg, options);
final MapiCalendar tmpCal = (MapiCalendar) mapi.toMapiMessageItem();
tmpFolder.addMapiMessageItem(tmpCal);

Please advise.
Thanks.

event.ical.zip (922 Bytes)


#2

@slavago,

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.


#3

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.

Thanks


#4

@slavago,

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)


#5

Thanks,
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 ?
Thanks


#6

@slavago,

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


#7

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


#8

@slavago,

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.


#9

Thanks,
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:

java.lang.NullPointerException
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)

Thanks


#10

@slavago,

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.


#11

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.
Thanks


#12

@slavago,

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.


#13

@slavago,

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.


Strange exception when adding sub folder in pst
#14

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


#15

@slavago,

You are very welcome.


#16

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


#17

@slavago,

Sure, next release will fix all issues.