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

Free Support Forum - aspose.com

Opening PST using traversal exceptions callback throws VerifyError

I am using Aspose Email. 21.8. I followed the instructions at https://docs.aspose.com/email/java/aspose-email-for-java-21-8-release-notes/, to use a traversal exceptions callback as follows:

       TraversalExceptionsCallback exceptionsCallback = new TraversalExceptionsCallback() {
            @Override
            public void invoke(TraversalAsposeException exception, String itemId) {
                // feedback.report(exception, itemId);
                System.out.println(exception.getMessage());
            }
        };
        personalStorage = new PersonalStorage(exceptionsCallback);
        if (!personalStorage.load(file.toString()))
            throw new IllegalStateException("failed to load pst file "+file+". The PST is likely corrupted.");

However, the above outputs the following:

 2021-09-09 05:21:28 c.s.a.i.AsposePSTContainer [DEBUG] failed open 
 {file=C:\\test.pst}

java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
com/aspose/email/TraversalExceptionsCallback.beginInvoke(Lcom/aspose/email/TraversalAsposeException;Ljava/lang/String;Lcom/aspose/email/system/AsyncCallback;Ljava/lang/Object;)Lcom/aspose/email/system/IAsyncResult; @14: invokestatic
Reason:
Type ‘com/aspose/email/zbih’ (current frame, stack[0]) is not assignable to ‘com/aspose/email/internal/ex/zb’
Current Frame:
bci: @14
flags: { }
locals: { ‘com/aspose/email/TraversalExceptionsCallback’, ‘com/aspose/email/TraversalAsposeException’, ‘java/lang/String’, ‘com/aspose/email/system/AsyncCallback’, ‘java/lang/Object’ }
stack: { ‘com/aspose/email/zbih’ }
Bytecode:
0x0000000: bb00 0459 2a2a 2d19 042b 2cb7 0008 b800
0x0000010: 05b0

Could this error be due to code obfuscation on the part of Aspose?

@jamie-1,
Thank you for posting the query. To investigate this case on our side, could you share the PST file, please?

Andrey this happens when you created a PST file. Please refer to the code.

@jamie-1,
Your above code snippet contains the next line:

if (!personalStorage.load(file.toString()))

Please share the file you loaded.

This error happens with any PST file. However, you can download from here

@jamie-1,
Thank you for the additional information. I will reply to you as soon as possible.

@jamie-1,
I used your code snippet and the PST file and found no errors. It seems to be the error is environment-specific. Please specify the following:

  • OS version where the error occurred
  • JDK version you used

Any additional information would be useful as well.