domino-jna
domino-jna copied to clipboard
com.mindoo.domino.jna.errors.NotesError: Entry not found in index (error code: 1028, raw error with all flags: 1028)
Hi Klehmann,
An error occurred when calling writeImage method if the mail contained images in nested reply mails. I have attached a .nsf file for your reference.
Let's see if you have any idea for the issue.
Here are the error log and the reference code
Error log:
filename:File2ERKSwoPreview.png com.mindoo.domino.jna.errors.NotesError: Entry not found in index (error code: 1028, raw error with all flags: 1028) at com.mindoo.domino.jna.errors.NotesErrorUtils.toNotesError(NotesErrorUtils.java:53) at com.mindoo.domino.jna.errors.NotesErrorUtils.checkResult(NotesErrorUtils.java:26) at com.mindoo.domino.jna.NotesNote.convertHtmlElement(NotesNote.java:4089) at com.mindoo.domino.jna.NotesNote.convertHtmlElement(NotesNote.java:4032) at com.mindoo.domino.jna.NotesNote$HtmlConversionResult$1.writeImage(NotesNote.java:4261) at com.cmmp.hk.unclassified.MailbodyParser.extractInlineIcons(MailbodyParser.java:160) at com.cmmp.hk.unclassified.MailbodyParser.Parse(MailbodyParser.java:53) at com.cmmp.hk.unclassified.MailMigrator.migrate(MailMigrator.java:49) at com.cmmp.hk.CMMPMailMigrator.lambda$migrateMail$0(CMMPMailMigrator.java:304) at com.mindoo.domino.jna.gc.NotesGC.runWithAutoGC(NotesGC.java:481) at com.cmmp.hk.CMMPMailMigrator.migrateMail(CMMPMailMigrator.java:175) at com.cmmp.hk.CMMPMailMigrator.test(CMMPMailMigrator.java:548) at com.cmmp.hk.App.main(App.java:185)
Reference code:
IHtmlImageRef image = null;
String imgSrc = inlineIcon.attr("src");
for (int i = 0; i < images.size(); i++) {
if (images.get(i).getReferenceText().equalsIgnoreCase(imgSrc)) {
image = images.get(i);
break;
}
}
String imgCID = java.util.UUID.randomUUID().toString();
String fileName = inlineIcon.attr("alt");
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
System.out.println("filename:"+ fileName);
if (image != null) {
image.writeImage(byteArrayOutputStream);
}
byteArrayOutputStream.flush();
byte[] originalImg = byteArrayOutputStream.toByteArray();
byteArrayOutputStream.close();
I think I finally fixed this one: https://github.com/klehmann/domino-jna/commit/117af3f1b6c94bdceb1555c060d0f3830930f515
Please try with 0.9.42 when it is available.