Exception: NegativeArraySizeException on adding sub folder in PST (Java)

When I’m making PST in Linux server, where I have 3 threads each one is creating separate PST after few days of work I got about 1 Million exception like that when I’m trying to add sub-folders.

I know that you’ll ask for the samples that reproduce that issue, but it’s happens only in multi-threaded environment that I described and on random emails, so I can provide you and easy way to reproduce this problem, but I’m asking you to investigate this issue, as it’s clearly inside your code.

What I can do, is, if you provide me a custom JAR with additional logging, I can put this into running environment and it can put more lights on the issue, we did this in the past with you.

This issue is very annoying as it’s not new, but today it’s just broke all possible records.

java.lang.NegativeArraySizeException
at com.aspose.email.wv$a.a(SourceFile:1057)
at com.aspose.email.wv.a(SourceFile:462)
at com.aspose.email.wv.a(SourceFile:270)
at com.aspose.email.ez.a(SourceFile:271)
at com.aspose.email.ez.a(SourceFile:203)
at com.aspose.email.ayp.a(SourceFile:260)
at com.aspose.email.aeb.g(SourceFile:1958)
at com.aspose.email.aeb.c(SourceFile:766)
at com.aspose.email.aqm.c(SourceFile:1012)
at com.aspose.email.FolderInfo.addSubFolder(SourceFile:675)
at com.aspose.email.FolderInfo.addSubFolder(SourceFile:625)

Thanks

@slavago,

I have observed your comments and we will sure investigate this issue on our end to help you out as soon as possible. Can you please share sample code, source file along with environment details so that we may help you out.

Well, there’s no single code sample as all logic how and what folders to create is based on our metadata (folders hierarchy is something we hold internaly) so I can send few chunks of code how we add email to pst and how we create sub folder, but it’s not single method that you can run.

But again, it’s just a call for sub folder creation based on the folder name and based on the parent folder.
Thanks

@slavago,

I like to inform that simply based on stack trace we may not be in position to identify the root cause of the issue. We need to have a working sample project and source files used that is producing issue on your end. We will try the same on our end to reproduce and then resolve the issue. Unfortunately, simply based on stack trace we may not be in position to identify the root cause of the issue. We really wish to help you out every possible way and therefore request you to provide the requested information.

As I said in the first message, maybe you can provide custom version jar with more logs in this case I can run it un real servers to get any information you need.
I really want also to provide you an working sample as I did in all tickets I’ve opened, but in this case it’s almost imposibke as this will require our entire server code with all metadata (that’s is confidential), so I do want to provide you any information that can assist to solve this annoying issue, but working sample is something that simple imposible, as folder and sub folders creation based on the customer mailbox metadata, please understand this.
Is there anything else that can help you here to understand the issue?
Thanks

@slavago

I have observed your following comments and regret to share that it may not be possible. However, I will discuss this internally and will get back to you in this regard regarding its possibility. Is there any other way we may verify the issue if the custom Jar option is not possible for us?

Hi, Is there any update ? can we somehow work together to solve this issue, and btw, it’s not only one issue, when code runs in the multi threaded environment (each thread creates different PST) we see few different strange issues, so I think there some thread safety issues within your library, for few years already and now it’s just starting to be very annoying and I think we as a paying customer want those issues to be solved even if it’s not easy to reproduce them.

Thanks

@slavago,

I like to inform that we have created an issue with ID EMAILJAVA-34535 in our issue tracking system to investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once issue will be fixed.

Great , thanks. If you need anything that can help you, please tell.
As I said earlier, in the past you guys provided us a version with additional logging, and this helped you to fix similar issues. Maybe it can help this time as well.

@slavago,

We will request you to share further information, if we may need that on our end or may even provide you a custom JAR for further details. I request you to please be patient till the time we investigate the issue internally on our end.

@slavago,

We have fixed some PST issues and have build a hotfix release 19.5.2. We may provide more elaborate log information. However, we like to know if the issue will be reproduced on the your side with shared hotfix.

https://www.dropbox.com/s/ww6ib42lidlr18m/aspose-email-19.5.2-java.zip?dl=0

Will put it into test soon and let you know.
Thanks

@slavago

We will await feedback from your side.

So far so good, previous issues with many threads not observed any more. So we’ll continue to run this and if will see something new will let you know. Didn’t see in log any information (errors or anything else).

Thanks

@slavago,

It’s good to know that things are well on your end. Please feel free to share if there is any issue incurring on your end.

Well, I tried to switch yo 19.6 version as 19.5.2 has some issues with adding calendar events to pst that 19.6 works fine with that, but with 19.6 started to see same issues with multi-threading. That were not present in 19.5.2.

class com.aspose.email.system.exceptions.InvalidOperationException: Operation is not valid due to the current state of the object.

com.aspose.email.internal.d.zc.b(Unknown Source)

com.aspose.email.internal.d.zc.a(Unknown Source)

com.aspose.email.internal.d.zc.removeItem(Unknown Source)

com.aspose.email.zada.b(SourceFile:76)

com.aspose.email.zbaq.c(SourceFile:573)

com.aspose.email.zbaq.a(SourceFile:472)

com.aspose.email.zbfe.a(SourceFile:819)

com.aspose.email.zfz.a(SourceFile:548)

com.aspose.email.zfz.e(SourceFile:437)

com.aspose.email.zfz.b(SourceFile:229)

com.aspose.email.Appointment.a(SourceFile:1438)

com.aspose.email.Appointment.b(SourceFile:1380)

com.aspose.email.Appointment.load(SourceFile:1373)

Thanks

@slavago,

I have associated information in our issue tracking system and will share further feedback with you as soon as issue will be addressed.

@slavago,

We have shared the hotfix version for your convenience in following forum thread as well. Can you please verify this.